Question

I want to test Django applications with special test data that is different from my initial_data fixtures. I added a test fixture to my test case, but Django still loads the initial_data fixtures.

How can it be avoided?

Was it helpful?

Solution

As you can see in this SO answer, you must choose another name for your normal fixture. initial_data.[xml/yaml/json] is always loaded automatically, even if you define another fixture for your tests.

  1. Rename your fixture to any other name
  2. Use loaddata after syncdb each time you need data
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top