django - “manage.py test”失败“表已经存在” [英] django - "manage.py test" fails "table already exists"
问题描述
非常感谢任何见解。
TIA
Joey
这可能是您的一个南方迁移中的错误。您没有看到真正的数据库中的问题,因为迁移已被执行(可以使用 - 假选项)
您可以尝试从scracth重新创建数据库并且看看它是否有效。
您还可以通过在您的...中添加 SOUTH_TESTS_MIGRATE = False
来禁用南方单元测试settings.py。使用此选项,将会创建一个常规syncdb来创建测试数据库。它也将加速测试过程。
希望它有助于
I'm new to the django world. Running some tutorial apps, and when running python manage.py test i'm getting a failure saying that the table already exists. I'm not sure what is going on. I am also running south, and I got no errors when migrating the schema.
Any insight is greatly appreciated.
TIA Joey
It might be an error in one of your south migrations. You don't see the problem on the real db because the migration has been executed (with the--fake option maybe)
You can try to recreate the db from scracth and see if it works.
You can also disable South for unit-tests by adding SOUTH_TESTS_MIGRATE = False
in your settings.py. With this option a regular syncdb will be done to create the test database. It will also speed the testing process.
I hope it helps
这篇关于django - “manage.py test”失败“表已经存在”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!