From d66b4225971eb1072977b6f03d98696d241dcd60 Mon Sep 17 00:00:00 2001 From: Erik Noren Date: Mon, 6 Jan 2014 08:58:10 -0600 Subject: [PATCH] Fix for issue #129 which would prevent REUSE_DB from working reliably when dealing with multiple DB's. --- django_nose/runner.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/django_nose/runner.py b/django_nose/runner.py index 5e126f5..a663a9d 100644 --- a/django_nose/runner.py +++ b/django_nose/runner.py @@ -331,6 +331,11 @@ def setup_databases(self): creation = connection.creation test_db_name = creation._get_test_db_name() + # Close the connection ahead of doing a DB check as the connection + # may already be established which will short circuit the + # "should create" tests + connection.close() + # Mess with the DB name so other things operate on a test DB # rather than the real one. This is done in create_test_db when # we don't monkeypatch it away with _skip_create_test_db.