South 是否搞乱了 Django 测试运行框架?
我有一个 Django 项目,大约一半时我向其中添加了 South 应用程序,以使数据库迁移更容易。
我在项目中的几个有限位置使用 Django 单元测试框架,这意味着我不会定期运行测试。我最近为代码的新部分编写了一些新测试,并尝试运行它们。我收到以下错误:
django.db.utils.DatabaseError: no such table: auth_permission
回溯提到了一些 South 文件(例如 /Library/Python/2.7/site-packages/south/management/commands/test.py
)。南会不会对试跑者犯规?
I’ve got a Django project, to which I added the South app about halfway through to make database migrations easier.
I use the Django unit test framework in a couple of limited places in the project, meaning I don’t run the tests regularly. I recently wrote some new tests for a new part of the code, and attempted to run them. I got the following error:
django.db.utils.DatabaseError: no such table: auth_permission
The traceback mentioned some South files (e.g. /Library/Python/2.7/site-packages/south/management/commands/test.py
). Could South be fouling up the test runner?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能 - 毫无疑问我在某个地方做错了什么,但 South 的文档在这里提到了可能的问题:
我将
SOUTH_TESTS_MIGRATE = False
添加到我的 settings.py 文件中,并且我的测试再次运行良好。但是,我的测试目前不涉及数据库,因此我可能需要重新审视这一点。
Possibly — doubtless I’ve done something wrong somewhere, but South’s documentation mentions possible issues here:
I added
SOUTH_TESTS_MIGRATE = False
to my settings.py file, and my tests ran fine again.However, my tests don’t currently involve the database, so I might have to revisit this.