multidb, don't create one of them during unit tests

9 views
Skip to first unread message

Rich Rauenzahn

unread,
May 29, 2018, 3:09:46 PM5/29/18
to Django users
I'm using Django's (1.11) typical default db for my regular Django development, but I need to integrate with someone else's bugzilla db server running on mysql somewhere else (no web api available, mysql is the recommendation from them).     So I've added a 2nd DB to my DB config pointing to their server.  I've used inspectdb to bring in their schema as models.

They have both a production instance and a test instance for reading bugs.  These are both read only.

I'd like my unit tests to skip creating the test instance of their DB (since I'm not even running a mysql server to use, I don't have write access to theirs, and their test instance is already populated) and to just point my unit tests at their test instance.

I see I can override the TestRunner ....


setup_databases in django.test.utils seems to take a global for keepdb so it doesn't seem like someone can choose on a per db basis ...

Is this possible?  How?

Rich Rauenzahn

unread,
May 29, 2018, 3:49:50 PM5/29/18
to Django users
On Tuesday, May 29, 2018 at 12:09:46 PM UTC-7, Rich Rauenzahn wrote:

Is this possible?  How?


Ah, found this thread which suggests just using sqlite locally... I'll give it a try:

Reply all
Reply to author
Forward
0 new messages