Skip to content

Commit

Permalink
Always show database (file) name when test database destruction is su…
Browse files Browse the repository at this point in the history
…ppressed.

You probably suppressed it because you want to access the database
afterwards for post-mortem, so it makes sense to report the database
name even if you didn't up the verbosity as well.
  • Loading branch information
qris committed Jan 9, 2013
1 parent e78ab7e commit 9861b23
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions monkeypatches.py
Expand Up @@ -293,10 +293,17 @@ def errors(self):
django.contrib.admin.helpers.Fieldline = FieldlineWithCustomReadOnlyField

from django.db.backends.creation import BaseDatabaseCreation
# @patch(BaseDatabaseCreation, 'destroy_test_db')
def destroy_test_db_disabled(original_function, self, test_database_name,
verbosity):
pass
# patch(BaseDatabaseCreation, 'destroy_test_db', destroy_test_db_disabled)
"""
Temporarily disable the deletion of a test database, for post-mortem
examination.
"""
test_database_name = self.connection.settings_dict['NAME']
if verbosity >= 1:
print("Not destroying test database for alias '%s' (%s)..." % (
self.connection.alias, test_database_name))

if not hasattr(auth_models.Group, 'natural_key'):
"""
Expand Down

0 comments on commit 9861b23

Please sign in to comment.