简体   繁体   English

如何使用django-admin.py运行特定测试?

[英]How to run specific tests with django-admin.py?

I have an app located at app/ and tests which reside at app/tests/tests.py . 我有一个位于app/的应用app/和位于app/tests/tests.py How can I run those tests with django-admin.py ? 如何使用django-admin.py运行这些测试?

I tried django-admin.py test app , django-admin.py test app.tests and django-admin.py test app.tests.tests but with no success. 我尝试了django-admin.py test appdjango-admin.py test app.testsdjango-admin.py test app.tests.tests但没有成功。

I add that I am also adding the --settings param to the above commands but cut it off for readability. 我补充说,我还在上面的命令中添加了--settings参数,但为了便于阅读而将其删除。

You need to use manage.py instead on django-admin.py . 您需要在django-admin.py上使用manage.py So run ./manage.py test app 所以运行./manage.py test app

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM