Can I test a Django app without having the initial

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.

  • Rename your fixture to any other name
  • Use loaddata after syncdb each time you need data
  • 链接地址: http://www.djcxy.com/p/52306.html

    上一篇: 如何在测试运行器中为Django测试加载fixture?

    下一篇: 我可以测试一个Django应用程序,而无需初始化