Description
https://docs.djangoproject.com/en/2.2/topics/testing/overview/#rollback-emulation
When using the transactional_db
or live_server
fixtures, during cleanup, Django will truncate the tables.
If you have data migrations that provide initial data, that initial data will be wiped as well.
By using the serialized_rollback
attribute in TestCases, it should enable you to load the initial data at the start of every test, but using pytest-django
means you can't edit the TestCase classes directly.
I propose a mark, django_serialized_rollback
(?), which if present, will enable the serialized_rollback
attribute, thus enabling this behavior.
Wanted to open an issue first to check that was the right way of going about this, before actually writing the tests and code for it.