(Cross-posted here: https://github.com/jbalogh/django-nose/issues/129)
In settings.py I have two databases listed:
DATABASES = {
'default': {
'ENGINE': 'mysql_pymysql',
'NAME': 'OST_DEV_1',
'USER': 'root',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '3306',
},
'umc': {
'ENGINE': 'mysql_pymysql',
'NAME': 'UMC',
'USER': 'root',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '3306',
}
}
If I run the tests without REUSE_DB, they work, but slowly (nearly 2 minutes spent just on creating/destroying the databases):
bash
./manage.py test myapp
But this fails:
REUSE_DB=1 ./manage.py test myapp
DatabaseError: (1146, u"Table 'OST_DEV_1.tblMfg' doesn't exist")
This makes sense, as tblMfg is in the UMC database, not OST_DEV_1. Is there a way to tell django-nose where to find tblMfg? Note that my tests themselves don't reference tblMfg -- I'm sticking to 1+1 == 2 for now.
We currently use 'using' manually for tables that are in UMC:
active_mfgs = Mfg.objects.using('umc').filter(status="ACTIVE")