mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-12-23 23:23:06 +11:00
No need to handle version 1.7 Django anymore so removing those cases from runtests.py (#102)
This commit is contained in:
parent
48c77e6ad8
commit
27d608e5da
1 changed files with 6 additions and 12 deletions
18
runtests.py
18
runtests.py
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue