summaryrefslogtreecommitdiff
path: root/django/test/utils.py
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-08-16 22:46:00 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-08-16 22:46:00 +0000
commit49c438fd219c8bc1ee1a32b98ef3777abeb289f6 (patch)
tree35a758196c68f476123152e43e09127b50a38ceb /django/test/utils.py
parent89ebb6177df63d17de069dfc9304e83d9b829848 (diff)
downloaddjango-49c438fd219c8bc1ee1a32b98ef3777abeb289f6.tar.gz
Changed django.test.utils.create_test_db to return the name of the test database that was created
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5910 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/test/utils.py')
-rw-r--r--django/test/utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/django/test/utils.py b/django/test/utils.py
index ae3798634e..bc53ef4bfb 100644
--- a/django/test/utils.py
+++ b/django/test/utils.py
@@ -90,6 +90,10 @@ def get_postgresql_create_suffix():
return ''
def create_test_db(verbosity=1, autoclobber=False):
+ """
+ Creates a test database, prompting the user for confirmation if the
+ database already exists. Returns the name of the test database created.
+ """
# If the database backend wants to create the test DB itself, let it
creation_module = get_creation_module()
if hasattr(creation_module, "create_test_db"):
@@ -153,6 +157,8 @@ def create_test_db(verbosity=1, autoclobber=False):
# the side effect of initializing the test database.
cursor = connection.cursor()
+ return TEST_DATABASE_NAME
+
def destroy_test_db(old_database_name, verbosity=1):
# If the database wants to drop the test DB itself, let it
creation_module = get_creation_module()