mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2024-12-12 18:00:45 +01:00
added test running compatibility for django 1.8, workin in 1.6 and 1.7
This commit is contained in:
parent
f5401b6887
commit
05625d0bfd
17
quicktest.py
17
quicktest.py
@ -93,14 +93,27 @@ class QuickDjangoTest(object):
|
||||
STATIC_URL = '/static/'
|
||||
)
|
||||
|
||||
try:
|
||||
# Django <= 1.8
|
||||
from django.test.simple import DjangoTestSuiteRunner
|
||||
test_runner = DjangoTestSuiteRunner(verbosity=1)
|
||||
except ImportError:
|
||||
# Django >= 1.8
|
||||
from django.test.runner import DiscoverRunner
|
||||
test_runner = DiscoverRunner(verbosity=1)
|
||||
|
||||
if django.VERSION >= (1, 7):
|
||||
django.setup()
|
||||
|
||||
from django.test.simple import DjangoTestSuiteRunner
|
||||
failures = DjangoTestSuiteRunner().run_tests(self.apps, verbosity=1)
|
||||
failures = test_runner.run_tests(self.apps)
|
||||
if failures:
|
||||
sys.exit(failures)
|
||||
|
||||
# from django.test.simple import DjangoTestSuiteRunner
|
||||
# failures = DjangoTestSuiteRunner().run_tests(self.apps, verbosity=1)
|
||||
# if failures:
|
||||
# sys.exit(failures)
|
||||
|
||||
if __name__ == '__main__':
|
||||
"""
|
||||
What do when the user hits this file from the shell.
|
||||
|
Loading…
Reference in New Issue
Block a user