Skip to content

Commit

Permalink
attempts to fix tests for django 1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
mtford90 committed Apr 8, 2015
1 parent 989dc26 commit e971ab8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import django
setup = getattr(django, 'setup', None)
if setup:
setup()
7 changes: 5 additions & 2 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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
}
}

Expand Down
1 change: 1 addition & 0 deletions tests/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ pytz>2014.2
mock==1.0.1
Pillow==2.5.1
nose
django-nose

0 comments on commit e971ab8

Please sign in to comment.