Disable Django South when running unit tests?

萝らか妹 提交于 2019-12-20 11:02:43

问题


Disable Django South when running unit tests? How do you avoid running all of the south migrations when doing django unit testing?


回答1:


Yes, the South documentation describes how to do it, but basically just add this to your settings.py file:

SOUTH_TESTS_MIGRATE = False # To disable migrations and use syncdb instead
SKIP_SOUTH_TESTS = True # To disable South's own unit tests



回答2:


Even though, you have selected the good answer, I think that you should consider the option SOUTH_TESTS_MIGRATE instead. It will prevent to run all the migrations on your test db, and run syncdb instead.



来源:https://stackoverflow.com/questions/5798446/disable-django-south-when-running-unit-tests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!