You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
https://docs.djangoproject.com/en/2.2/topics/testing/overview/#rollback-emulation
When using the
transactional_db
orlive_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 usingpytest-django
means you can't edit the TestCase classes directly.I propose a mark,
django_serialized_rollback
(?), which if present, will enable theserialized_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.
The text was updated successfully, but these errors were encountered: