We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ede3a17 commit 498d32fCopy full SHA for 498d32f
django_nose/runner.py
@@ -437,6 +437,11 @@ def _should_create_database(connection):
437
438
# Notice whether the DB exists, and create it if it doesn't:
439
try:
440
+ # Connections are cached by some backends, if other code has connected
441
+ # to the database previously under a different database name the
442
+ # cached connection will be used and no exception will be raised.
443
+ # Setting to null here solves that problem.
444
+ connection.connection = None
445
connection.cursor()
446
except Exception: # TODO: Be more discerning but still DB agnostic.
447
return True
0 commit comments