Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test runner should be compat with 1.3 and 1.4

  • Loading branch information...
commit c4b264c08e728668443613a028bbcaa38c3f1149 1 parent a26660a
@coleifer authored
Showing with 8 additions and 7 deletions.
  1. +8 −7 runtests.py
View
15 runtests.py
@@ -2,20 +2,20 @@
import sys
from os.path import dirname, abspath
+import django
from django.conf import settings
if len(sys.argv) > 1 and 'postgres' in sys.argv:
sys.argv.remove('postgres')
- db_engine = 'postgresql_psycopg2'
+ db_engine = 'django.db.backends.postgresql_psycopg2'
db_name = 'test_main'
else:
- db_engine = 'sqlite3'
+ db_engine = 'django.db.backends.sqlite3'
db_name = ''
if not settings.configured:
settings.configure(
- DATABASE_ENGINE = db_engine,
- DATABASE_NAME = db_name,
+ DATABASES=dict(default=dict(ENGINE=db_engine, NAME=db_name)),
SITE_ID = 1,
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
@@ -38,15 +38,16 @@
],
)
-from django.test.simple import run_tests
-
+from django.test.utils import get_runner
def runtests(*test_args):
if not test_args:
test_args = ['relationships_tests']
parent = dirname(abspath(__file__))
sys.path.insert(0, parent)
- failures = run_tests(test_args, verbosity=1, interactive=True)
+ TestRunner = get_runner(settings)
+ test_runner = TestRunner(verbosity=1, interactive=True)
+ failures = test_runner.run_tests(test_args)
sys.exit(failures)
Please sign in to comment.
Something went wrong with that request. Please try again.