diff options
| author | Ramiro Morales <cramm0@gmail.com> | 2010-11-21 17:18:26 +0000 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2010-11-21 17:18:26 +0000 |
| commit | 752bd8bf75f1bf64e5014ee65b65b173197e5f53 (patch) | |
| tree | 274079c2174400c14b737fb1dfa4ccd7a0febca8 /django/db/backends | |
| parent | 67742073947efe60b103b2ebd07217d2a1c67e9d (diff) | |
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
Diffstat (limited to 'django/db/backends')
| -rw-r--r-- | django/db/backends/creation.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/django/db/backends/creation.py b/django/db/backends/creation.py index ce32012c2b..2cc239d969 100644 --- a/django/db/backends/creation.py +++ b/django/db/backends/creation.py @@ -340,11 +340,14 @@ class BaseDatabaseCreation(object): Creates a test database, prompting the user for confirmation if the database already exists. Returns the name of the test database created. """ - if verbosity >= 1: - print "Creating test database '%s'..." % self.connection.alias - test_database_name = self._create_test_db(verbosity, autoclobber) + if verbosity >= 1: + test_db_repr = '' + if verbosity >= 2: + test_db_repr = " ('%s')" % test_database_name + print "Creating test database for alias '%s'%s..." % (self.connection.alias, test_db_repr) + self.connection.close() self.connection.settings_dict["NAME"] = test_database_name @@ -411,10 +414,13 @@ class BaseDatabaseCreation(object): Destroy a test database, prompting the user for confirmation if the database already exists. Returns the name of the test database created. """ - if verbosity >= 1: - print "Destroying test database '%s'..." % self.connection.alias self.connection.close() test_database_name = self.connection.settings_dict['NAME'] + if verbosity >= 1: + test_db_repr = '' + if verbosity >= 2: + test_db_repr = " ('%s')" % test_database_name + print "Destroying test database for alias '%s'%s..." % (self.connection.alias, test_db_repr) self.connection.settings_dict['NAME'] = old_database_name self._destroy_test_db(test_database_name, verbosity) |
