Skip to content

Commit

Permalink
runtests compatibility for Django 1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
raisou committed Nov 9, 2014
1 parent 8aa006d commit 7973f37
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions runtests.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python
import logging
import sys
from os.path import dirname, abspath

from django.conf import settings
from django.utils.version import get_version

if not settings.configured:
settings.configure(
Expand All @@ -18,18 +18,23 @@
ROOT_URLCONF='',
DEBUG=False,
)
if get_version().split('.')[1] == '7':
from django.apps import apps
apps.populate(settings.INSTALLED_APPS)

from django.test.simple import run_tests

from django.test.simple import DjangoTestSuiteRunner
test_runner = DjangoTestSuiteRunner(verbosity=1, interactive=True)


def runtests(*test_args):
if not test_args:
test_args = ['disqus']
parent = dirname(abspath(__file__))
sys.path.insert(0, parent)
failures = run_tests(test_args, verbosity=1, interactive=True)
failures = test_runner.run_tests(test_args)
sys.exit(failures)


if __name__ == '__main__':
runtests(*sys.argv[1:])
runtests(*sys.argv[1:])

0 comments on commit 7973f37

Please sign in to comment.