tests are correctly discovered for django < 1.6

This commit is contained in:
Alex Seeholzer
2015-11-13 15:35:36 +01:00
parent 50877c3708
commit cd0daccb56
2 changed files with 13 additions and 10 deletions

View File

@ -97,13 +97,13 @@ class QuickDjangoTest(object):
# see: http://stackoverflow.com/questions/3841725/how-to-launch-tests-for-django-reusable-app
try:
# Django <= 1.8
from django.test.simple import DjangoTestSuiteRunner
test_runner = DjangoTestSuiteRunner(verbosity=1)
except ImportError:
# Django >= 1.8
# Django >= 1.6
from django.test.runner import DiscoverRunner
test_runner = DiscoverRunner(verbosity=1)
except ImportError:
# Django <= 1.5
from django.test.simple import DjangoTestSuiteRunner
test_runner = DjangoTestSuiteRunner(verbosity=1)
if django.VERSION >= (1, 7):
django.setup()