From e971ab8389a702fdddde9e73830cde33de8ae73e Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Wed, 8 Apr 2015 08:59:25 +0100 Subject: [PATCH] attempts to fix tests for django 1.7 --- tests/__init__.py | 4 ++++ tests/settings.py | 7 +++++-- tests/test-requirements.txt | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index e69de29b..cf845ace 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1,4 @@ +import django +setup = getattr(django, 'setup', None) +if setup: + setup() \ No newline at end of file diff --git a/tests/settings.py b/tests/settings.py index a70549c6..6d05f5e1 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -20,16 +20,19 @@ 'django.contrib.messages', 'django.contrib.sessions', 'silk', + 'django_nose', 'example_app' ) +TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' + # A quick hack to get tests to pass for django 1.5 if django.VERSION < (1, 6): INSTALLED_APPS += ("tests", ) ROOT_URLCONF = 'tests.urls' else: - ROOT_URLCONF = 'urls' + ROOT_URLCONF = 'urls' MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', @@ -45,11 +48,11 @@ DB_NAME = os.path.join(BASE_DIR, 'db.sqlite3') - DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': DB_NAME, + 'TEST_NAME': DB_NAME } } diff --git a/tests/test-requirements.txt b/tests/test-requirements.txt index 46d5c7e1..9c1c5ca2 100644 --- a/tests/test-requirements.txt +++ b/tests/test-requirements.txt @@ -10,3 +10,4 @@ pytz>2014.2 mock==1.0.1 Pillow==2.5.1 nose +django-nose