运行单元测试时禁用Django South?

时间:2011-04-27 01:45:19

标签: django unit-testing django-south

运行单元测试时禁用Django South?在进行django单元测试时,如何避免运行所有南迁移?

2 个答案:

答案 0 :(得分:68)

是的,South documentation描述了如何操作,但基本上只需将其添加到settings.py文件中:

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

答案 1 :(得分:31)

即使您选择了好的答案,我认为您应该考虑选项SOUTH_TESTS_MIGRATE。它将阻止在测试数据库上运行所有迁移,而是运行syncdb