Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #2916 -- Moved syncdb call out of simple test runner and into c…

…reate_test_db, to match documentation and simplify testing process for people using other test frameworks. Thanks, remco@diji.biz.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4541 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit fb509ee8d3c67efd28beef2df463b62ef883c17a 1 parent 895633a
Russell Keith-Magee authored February 18, 2007
1  AUTHORS
@@ -154,6 +154,7 @@ answer newbie questions, and generally made Django that much better:
154 154
     Michael Radziej <mir@noris.de>
155 155
     ramiro
156 156
     Brian Ray <http://brianray.chipy.org/>
  157
+    remco@diji.biz
157 158
     rhettg@gmail.com
158 159
     Oliver Rutherfurd <http://rutherfurd.net/>
159 160
     Ivan Sagalaev (Maniac) <http://www.softwaremaniacs.org/>
2  django/test/simple.py
... ...
@@ -1,6 +1,5 @@
1 1
 import unittest, doctest
2 2
 from django.conf import settings
3  
-from django.core import management
4 3
 from django.test.utils import setup_test_environment, teardown_test_environment
5 4
 from django.test.utils import create_test_db, destroy_test_db
6 5
 from django.test.testcases import OutputChecker, DocTestRunner
@@ -78,7 +77,6 @@ def run_tests(module_list, verbosity=1, extra_tests=[]):
78 77
 
79 78
     old_name = settings.DATABASE_NAME
80 79
     create_test_db(verbosity)
81  
-    management.syncdb(verbosity, interactive=False)
82 80
     unittest.TextTestRunner(verbosity=verbosity).run(suite)
83 81
     destroy_test_db(old_name, verbosity)
84 82
     
3  django/test/utils.py
... ...
@@ -1,6 +1,7 @@
1 1
 import sys, time
2 2
 from django.conf import settings
3 3
 from django.db import connection, transaction, backend
  4
+from django.core import management
4 5
 from django.dispatch import dispatcher
5 6
 from django.test import signals
6 7
 from django.template import Template
@@ -84,6 +85,8 @@ def create_test_db(verbosity=1, autoclobber=False):
84 85
     connection.close()
85 86
     settings.DATABASE_NAME = TEST_DATABASE_NAME
86 87
 
  88
+    management.syncdb(verbosity, interactive=False)
  89
+
87 90
     # Get a cursor (even though we don't need one yet). This has
88 91
     # the side effect of initializing the test database.
89 92
     cursor = connection.cursor()

0 notes on commit fb509ee

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