Does anybody know how to run Django Tests using pytest-django against an existing (e.g. production) database?
I know that in general, this is not what unit tests are supposed to do, but in my case, I'm running the tests on Heroku. By default, Django creates a new test database, however, this is not possible on Heroku.
I found a solution that would work without pytest-django (python manage.py test
): https://gist.github.com/gregsadetsky/5018173
but as far as I understood, pytest-django doesn't make use of the test runner defined in the Django settings.
If anybody has another approach on how to run Django tests using pytest-django on Heroku (e.g. by automating a way to create the test database) I would be happy with that solution as well.