aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMjumbe Wawatu Poe2012-03-15 18:28:37 -0400
committerBen Firshman2014-09-20 15:32:13 -0700
commit2b6c9226593104583fda8e17654a7d6de6534e41 (patch)
treeb4debc4f6e268acda40b1a917c67655e23b5b877
parent0451c3f39e3cde5e7921a67975f759b0f2b062a3 (diff)
downloaddjango-shorturls-2b6c9226593104583fda8e17654a7d6de6534e41.tar.bz2
Add test settings to work in Django 1.4
-rw-r--r--.travis.yml2
-rw-r--r--src/shorturls/testsettings.py12
2 files changed, 12 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index a3c4df7..5b3789b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,4 +13,4 @@ env:
install: pip install $DJANGO --use-mirrors
# command to run tests
-script: django-admin.py test --pythonpath=src/shorturls/ --settings=testsettings
+script: django-admin.py test --pythonpath=src/ --settings=shorturls.testsettings
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')