Skip to content

Commit 752bd8b

Browse files
committed
Added printing of the name of test database being created/destroyed, at verbosity level 2. Refs #14415.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14666 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 6774207 commit 752bd8b

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

django/db/backends/creation.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,14 @@ def create_test_db(self, verbosity=1, autoclobber=False):
340340
Creates a test database, prompting the user for confirmation if the
341341
database already exists. Returns the name of the test database created.
342342
"""
343-
if verbosity >= 1:
344-
print "Creating test database '%s'..." % self.connection.alias
345-
346343
test_database_name = self._create_test_db(verbosity, autoclobber)
347344

345+
if verbosity >= 1:
346+
test_db_repr = ''
347+
if verbosity >= 2:
348+
test_db_repr = " ('%s')" % test_database_name
349+
print "Creating test database for alias '%s'%s..." % (self.connection.alias, test_db_repr)
350+
348351
self.connection.close()
349352
self.connection.settings_dict["NAME"] = test_database_name
350353

@@ -411,10 +414,13 @@ def destroy_test_db(self, old_database_name, verbosity=1):
411414
Destroy a test database, prompting the user for confirmation if the
412415
database already exists. Returns the name of the test database created.
413416
"""
414-
if verbosity >= 1:
415-
print "Destroying test database '%s'..." % self.connection.alias
416417
self.connection.close()
417418
test_database_name = self.connection.settings_dict['NAME']
419+
if verbosity >= 1:
420+
test_db_repr = ''
421+
if verbosity >= 2:
422+
test_db_repr = " ('%s')" % test_database_name
423+
print "Destroying test database for alias '%s'%s..." % (self.connection.alias, test_db_repr)
418424
self.connection.settings_dict['NAME'] = old_database_name
419425

420426
self._destroy_test_db(test_database_name, verbosity)

0 commit comments

Comments
 (0)