1

I have a large django project (AskBot) that I am running the tests for. When I configure DATABASES to use sqlite, the tests pass. When I figure to use PostgreSQL, the tests pass, but when I configure to use MySQL, some of the tests fail. By inspecting the test database that is created during testing, I can see that the schema during the tests is missing some fields compared to the real schema. These fields seem to be present when I create the database using python manage.py syncdb and python manage.py migrate, but not present during the tests.

Is this a common behavior in django, or could someone experienced in django suggest a next step? Thanks.

4

1 回答 1

1

如果您没有明确地将SOUTH_TESTS_MIGRATE设置设置为False- 将通过南迁移创建测试数据库。尝试将其设置为,看看您在正常和测试运行期间的False方案是否会有任何差异。syncdb

希望我猜对了。

也可以看看:

于 2013-05-22T19:06:22.157 回答