Sashko Lykhenko
Sashko Lykhenko

Reputation: 1654

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

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

Upvotes: 1

Views: 345

Answers (1)

Aldarund
Aldarund

Reputation: 17621

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

Upvotes: 1

Related Questions