Вопрос

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?

Это было полезно?

Решение

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
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top