Commit 26ce59d1 by Luke Plant

Added method to allow selected tests to be run, instead of running all.

This also removes the use of the deprecated DjangoTestSuiteRunner class
parent 6b300ac7
#!/usr/bin/env python
import sys
import django
from django.conf import settings
settings.configure(
......@@ -46,14 +47,23 @@ settings.configure(
SOUTH_TESTS_MIGRATE=True,
)
from django.test.simple import DjangoTestSuiteRunner
test_runner = DjangoTestSuiteRunner(verbosity=1)
# If you use South for migrations, uncomment this to monkeypatch
# syncdb to get migrations to run.
from south.management.commands import patch_for_test_db_setup
patch_for_test_db_setup()
failures = test_runner.run_tests(['wiki', ])
if failures:
sys.exit(failures)
\ No newline at end of file
from django.core.management import execute_from_command_line
argv = [sys.argv[0], "test"]
if len(sys.argv) == 1:
# Nothing following 'runtests.py':
if django.VERSION < (1,6):
argv.append("wiki")
else:
argv.append("wiki.tests")
else:
# Allow tests to be specified:
argv.extend(sys.argv[1:])
execute_from_command_line(argv)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment