summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2006-08-31 14:29:47 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2006-08-31 14:29:47 +0000
commitfc2d5f461f398bf048e8b821142019ddba9a677d (patch)
tree17154155ca61084eff8083ca7da2fb543fdc9d2b /django
parentd9883e1dec9c80c49749f798890ae5a3efd781f0 (diff)
Refs #2333 - Added more documentation for testing framework, and clarified some code as a result of trying to describe it.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3689 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/test/simple.py3
-rw-r--r--django/test/utils.py3
2 files changed, 2 insertions, 4 deletions
diff --git a/django/test/simple.py b/django/test/simple.py
index e72f693459..2469f80b3a 100644
--- a/django/test/simple.py
+++ b/django/test/simple.py
@@ -61,7 +61,8 @@ def run_tests(module_list, verbosity=1, extra_tests=[]):
for test in extra_tests:
suite.addTest(test)
- old_name = create_test_db(verbosity)
+ old_name = settings.DATABASE_NAME
+ create_test_db(verbosity)
management.syncdb(verbosity, interactive=False)
unittest.TextTestRunner(verbosity=verbosity).run(suite)
destroy_test_db(old_name, verbosity)
diff --git a/django/test/utils.py b/django/test/utils.py
index dd48d95aea..be011b864c 100644
--- a/django/test/utils.py
+++ b/django/test/utils.py
@@ -50,14 +50,11 @@ def create_test_db(verbosity=1, autoclobber=False):
sys.exit(1)
connection.close()
- old_database_name = settings.DATABASE_NAME
settings.DATABASE_NAME = TEST_DATABASE_NAME
# Get a cursor (even though we don't need one yet). This has
# the side effect of initializing the test database.
cursor = connection.cursor()
-
- return old_database_name
def destroy_test_db(old_database_name, verbosity=1):
# Unless we're using SQLite, remove the test database to clean up after