Pregunta

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?

¿Fue útil?

Solución

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
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top