I
have a DomainForm class with a choice field populated from a table in
the database. I'm trying to test it using the Django testing tools, but I
get the error "django.db.utils.OperationalError: no such table: myapp_topleveldomain" (see the README in the Github repo for the full stack trace).
If
I first create my development database and migrate it, then I do not
have any error. I expected that the test would run on the test database
but it is not the case.
My test environment should work properly
as I also created a model test which runs correctly on the test database
and do not need the development database.
Can you tell me
what would be the proper way to write this test so that it runs on the
test database? Is it a bug with the Django testing tools or am I doing
something wrong when populating my ChoiceField?