No need to handle version 1.7 Django anymore so removing those cases from runtests.py (#102)

This commit is contained in:
Jason Moujaes 2018-03-03 14:57:51 -05:00 committed by Martin Mahner
parent 48c77e6ad8
commit 27d608e5da

View file

@ -1,7 +1,10 @@
#!/usr/bin/env python
import sys
import django
from django.conf import settings
from django.test.runner import DiscoverRunner as TestRunner
SETTINGS = {
'DATABASES': {
@ -51,19 +54,10 @@ def runtests(*test_args):
if not settings.configured:
settings.configure(**SETTINGS)
# New Django 1.7 app registry setup
try:
from django import setup
setup()
except ImportError:
pass
# New Django 1.8 test runner
try:
from django.test.runner import DiscoverRunner as TestRunner
except ImportError:
from django.test.simple import DjangoTestSuiteRunner as TestRunner
# app registry setup
django.setup()
# test runner
test_runner = TestRunner(verbosity=1)
failures = test_runner.run_tests(['dpaste'])
if failures: