문제

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