Disable Django South when running unit tests?

2019-03-14 05:46发布

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

2条回答
Juvenile、少年°
2楼-- · 2019-03-14 06:23

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
查看更多
ら.Afraid
3楼-- · 2019-03-14 06:30

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.

查看更多
登录 后发表回答