mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-04-02 03:30:23 +00:00
Remove compatibility code in runtests.py file
This commit is contained in:
parent
ef42eb43e7
commit
7d1f2b5be5
1 changed files with 4 additions and 11 deletions
15
runtests.py
15
runtests.py
|
|
@ -24,21 +24,14 @@ def runtests():
|
|||
if not settings.configured:
|
||||
settings.configure(**DEFAULT_SETTINGS)
|
||||
|
||||
# Compatibility with Django 1.7's stricter initialization
|
||||
if hasattr(django, 'setup'):
|
||||
django.setup()
|
||||
django.setup()
|
||||
|
||||
parent = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.insert(0, parent)
|
||||
|
||||
try:
|
||||
from django.test.runner import DiscoverRunner
|
||||
runner_class = DiscoverRunner
|
||||
test_args = ['model_utils.tests']
|
||||
except ImportError:
|
||||
from django.test.simple import DjangoTestSuiteRunner
|
||||
runner_class = DjangoTestSuiteRunner
|
||||
test_args = ['tests']
|
||||
from django.test.runner import DiscoverRunner
|
||||
runner_class = DiscoverRunner
|
||||
test_args = ['model_utils.tests']
|
||||
|
||||
failures = runner_class(
|
||||
verbosity=1, interactive=True, failfast=False).run_tests(test_args)
|
||||
|
|
|
|||
Loading…
Reference in a new issue