From fc2d5f461f398bf048e8b821142019ddba9a677d Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 31 Aug 2006 14:29:47 +0000 Subject: 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 --- django/test/simple.py | 3 ++- django/test/utils.py | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'django') 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 -- cgit v1.3