Skip to content

Commit 65de2be

Browse files
for bug jazzband#76 When REUSE_DB=1, the test suite would end up using the non-test database
1 parent b81f847 commit 65de2be

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

django_nose/runner.py

+5
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ def _should_create_database(connection):
297297

298298
# Notice whether the DB exists, and create it if it doesn't:
299299
try:
300+
# Slight modification to fix proposed at
301+
# https://github.com/jbalogh/django-nose/pull/101
302+
# for bug https://github.com/jbalogh/django-nose/issues/76
303+
for conn in connections.all():
304+
conn.close()
300305
connection.cursor()
301306
except Exception: # TODO: Be more discerning but still DB agnostic.
302307
return True

0 commit comments

Comments
 (0)