Testing Django apps that use South migrations

前提是你 提交于 2019-12-03 03:38:11

问题


I'm trying to create some Functional tests for a Django app that uses South migrations.
Eventually, I will also be creating Twill tests.

When I try to run the existing tests, the test database is not created successfully because of a problem with the South migrations. ( Fails @ 7th of 58 migrations )

It would seem that for the purpose of testing, it's better to build the test database from the Django models, like a syncdb would, than from South.

How do I set up the Django test suite to build the test database from the current model vs. trying to use South?


回答1:


The South setting SOUTH_TESTS_MIGRATE controls this behaviour.

Add this line to your settings.py file:

SOUTH_TESTS_MIGRATE = False


来源:https://stackoverflow.com/questions/5572546/testing-django-apps-that-use-south-migrations

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