Testing for Add-Ons

I want to generally develop my apps as re-usable apps, as described here:

I am also amost always using pytest for writing tests. However, when I do, the database does not get initialized, despite my having the pytest-django add-on for pytest installed. If I make the database persistent, ie, not in-memory, but using a regular file (sqlite3…), add a manage.py to the root of the app and also run the migrations manually, my tests work, so it’s really just that the test setup somehow doesn’t do it, even though I have called django.setup() from my conftest.py.

What are my options here, please?

I don’t think you should do that. I have never done that in any of my projects that use pytest-django. Maybe that is the issue?

Thank you very much! A first try indicates that this seems to work, with the one drawback that now, hammett now fails with “django.core.exceptions.AppRegistryNotReady: Apps aren’t loaded yet.”

But if regular pytest keeps working, then I’m almost happy already!