[英]What is happening when I run `python manage.py test` and on which port the django test server is listening?
[英]How to force to use new database when run python manage.py test in Django?
当我打字
python manage.py test
有时会询问我是否要删除测试数据库。
Type 'yes' if you would like to try deleting the test database 'test_replicate_live', or 'no' to cancel: yes
我想保留测试数据库,我知道命令是:
python manage.py test --keepdb
我想知道是否有一种方法可以强制删除测试数据库,而无需等待问题出现。
有时我只是提前知道,我想删除测试数据库。
是吗
python manage.py test --nokeepdb
你可以试试
python manage.py test --noinput
这将抑制提示,并且默认情况下会破坏测试数据库。
它记录在这里, https://docs.djangoproject.com/en/2.2/topics/testing/overview/#the-test-database
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.