How to make my test fixtures loaded only while testing in Django?

358 Views Asked by At

I have a Django project with production fixtures and testing fixtures. How to make testing fixtures loaded only while running tests?

1

There are 1 best solutions below

3
On BEST ANSWER

You just need to put it into fixtures property of your testcase class. Like this:

  class AnimalTestCase(TestCase):
      fixtures = ['mammals.json', 'birds']

Docs can be found here