jbalogh/django-nose — pull request #101 by alexjg (2012-10-21 01:42:49+00:00)
Title: Fix for REUSE_DB problems

I had a look into the specific problem on my machine. The essential problem is that several db backends cache their underlying connection. The nose test runner detects whether a new database is needed by calling `cursor()` on the backend after renaming the `NAME` field of the settings dictionary which the backend uses, this fails if the database does not exist, allowing nose to decide to create the database.

Unfortunately some backends cache their underlying connection objects so if any code connects to the database (which hasn't been renamed by django-nose yet) then any subsequent `cursor()` calls will succeed (as they use the cached connection) and nose is unable to detect that the database exists. The attached code fixes that.

Fixes #76