Migrations only for Testing

Hi everyone
Some of my test cases use specific data, and I don’t wanna define in setUp test case method. There is any way to define migrations only for test cases purposes?

If I get it right, I think you are looking for the concept of “fixtures”:

If is that so, you can have different options. But a good start would be by knowing how it works with Django’s TestCase engine: https://django-testing-docs.readthedocs.io/en/latest/fixtures.html

1 Like

Perfect answer. Thank you so much @kplaube
https://docs.djangoproject.com/en/3.0/topics/testing/tools/#django.test.TransactionTestCase.fixtures