-
-
Notifications
You must be signed in to change notification settings - Fork 33
Description
We added a data migration and are testing it using django-test-migrations. When running pytest with --create-db everything works fine. But when running it with --reuse-db the data added by the data migration is gone. Since this only happens when migration tests are part of the suite it seems that this is something that happens in this plugin.
pytest 7.1.3
django-test-migrations-1.2.0
Is there anything that could trigger this? Maybe: https://github.com/wemake-services/django-test-migrations/blob/master/django_test_migrations/migrator.py#L47
Probably unrelated but I noticed that Migrator.reset() causes the last migration to be re-applied (after a migration test that starts with the second last and applies the last one):
migrator.apply_initial_migration(('foo', '0001_...'))
migrator.apply_tested_migration(('foo', '0002_...'))The call to the migrate command will cause 0002 to be re-applied. If 0002 is a data migration it will attempt to add the same data again.