Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Test runner should be compat with 1.3 and 1.4

  • Loading branch information...
commit c4b264c08e728668443613a028bbcaa38c3f1149 1 parent a26660a
Charles Leifer authored September 05, 2012

Showing 1 changed file with 8 additions and 7 deletions. Show diff stats Hide diff stats

  1. 15  runtests.py
15  runtests.py
@@ -2,20 +2,20 @@
2 2
 import sys
3 3
 from os.path import dirname, abspath
4 4
 
  5
+import django
5 6
 from django.conf import settings
6 7
 
7 8
 if len(sys.argv) > 1 and 'postgres' in sys.argv:
8 9
     sys.argv.remove('postgres')
9  
-    db_engine = 'postgresql_psycopg2'
  10
+    db_engine = 'django.db.backends.postgresql_psycopg2'
10 11
     db_name = 'test_main'
11 12
 else:
12  
-    db_engine = 'sqlite3'
  13
+    db_engine = 'django.db.backends.sqlite3'
13 14
     db_name = ''
14 15
 
15 16
 if not settings.configured:
16 17
     settings.configure(
17  
-        DATABASE_ENGINE = db_engine,
18  
-        DATABASE_NAME = db_name,
  18
+        DATABASES=dict(default=dict(ENGINE=db_engine, NAME=db_name)),
19 19
         SITE_ID = 1,
20 20
         TEMPLATE_LOADERS = (
21 21
             'django.template.loaders.filesystem.load_template_source',
@@ -38,15 +38,16 @@
38 38
         ],
39 39
     )
40 40
 
41  
-from django.test.simple import run_tests
42  
-
  41
+from django.test.utils import get_runner
43 42
 
44 43
 def runtests(*test_args):
45 44
     if not test_args:
46 45
         test_args = ['relationships_tests']
47 46
     parent = dirname(abspath(__file__))
48 47
     sys.path.insert(0, parent)
49  
-    failures = run_tests(test_args, verbosity=1, interactive=True)
  48
+    TestRunner = get_runner(settings)
  49
+    test_runner = TestRunner(verbosity=1, interactive=True)
  50
+    failures = test_runner.run_tests(test_args)
50 51
     sys.exit(failures)
51 52
 
52 53
 

0 notes on commit c4b264c

Please sign in to comment.
Something went wrong with that request. Please try again.