aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml15
-rw-r--r--src/shorturls/tests/__init__.py4
-rw-r--r--src/shorturls/tests/test_templatetag.py2
-rw-r--r--src/shorturls/testsettings.py12
4 files changed, 29 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..fa25cb8
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,15 @@
+language: python
+python:
+ - "2.6"
+ - "2.7"
+
+env:
+ - DJANGO="Django==1.2"
+ - DJANGO="Django==1.3"
+ - DJANGO="Django==1.4.15"
+
+# command to install dependencies
+install: pip install $DJANGO --use-mirrors
+
+# command to run tests
+script: django-admin.py test --pythonpath=src/ --settings=shorturls.testsettings
diff --git a/src/shorturls/tests/__init__.py b/src/shorturls/tests/__init__.py
index 6687828..a1c5afe 100644
--- a/src/shorturls/tests/__init__.py
+++ b/src/shorturls/tests/__init__.py
@@ -1,4 +1,4 @@
from shorturls.tests.models import *
-from shorturls.tests.test_views import *
+from shorturls.tests.test_baseconv import *
from shorturls.tests.test_templatetag import *
-from shorturls.tests.test_baseconv import * \ No newline at end of file
+from shorturls.tests.test_views import *
diff --git a/src/shorturls/tests/test_templatetag.py b/src/shorturls/tests/test_templatetag.py
index 2127817..ec91908 100644
--- a/src/shorturls/tests/test_templatetag.py
+++ b/src/shorturls/tests/test_templatetag.py
@@ -3,7 +3,7 @@ from django.conf import settings
from django.test import TestCase
from shorturls.tests.models import Animal, Vegetable, Mineral
-class RedirectViewTestCase(TestCase):
+class TemplateTagTestCase(TestCase):
urls = 'shorturls.urls'
fixtures = ['shorturls-test-data.json']
diff --git a/src/shorturls/testsettings.py b/src/shorturls/testsettings.py
index 2098abf..408ea8b 100644
--- a/src/shorturls/testsettings.py
+++ b/src/shorturls/testsettings.py
@@ -1,8 +1,18 @@
import os
DEBUG = TEMPLATE_DEBUG = True
+
+# For Pre-Django 1.3
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = '/tmp/shorturls.db'
+
+# For Django 1.3 and beyond
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3'
+ }
+}
+
INSTALLED_APPS = ['shorturls']
ROOT_URLCONF = ['shorturls.urls']
-TEMPLATE_DIRS = os.path.join(os.path.dirname(__file__), 'tests', 'templates') \ No newline at end of file
+TEMPLATE_DIRS = os.path.join(os.path.dirname(__file__), 'tests', 'templates')