Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何自动销毁django测试数据库_Python_Database_Django_Testing_Hudson - Fatal编程技术网

Python 如何自动销毁django测试数据库

Python 如何自动销毁django测试数据库,python,database,django,testing,hudson,Python,Database,Django,Testing,Hudson,我目前正在尝试使用hudson自动化django测试,并且正在努力寻找一个选项,该选项将自动销毁测试数据库(如果它已经存在的话)(通常会要求确认销毁它,而自动测试显然无法提供) 任何建议都将不胜感激 干杯, R使用--help查看test命令的文档: >>> ./manage.py test --help Usage: ./manage.py test [options] [appname ...] Runs the test suite for the specifi

我目前正在尝试使用hudson自动化django测试,并且正在努力寻找一个选项,该选项将自动销毁测试数据库(如果它已经存在的话)(通常会要求确认销毁它,而自动测试显然无法提供)

任何建议都将不胜感激

干杯, R

使用--help查看test命令的文档:

>>> ./manage.py test --help   
Usage: ./manage.py test [options] [appname ...]

Runs the test suite for the specified applications, or the entire site if no apps are specified.

[...]

--noinput             Tells Django to NOT prompt the user for input of any
                      kind.

并使用--noinput,默认为销毁测试数据库;)

啊。成功了!这在地球上哪里有记录?在回答中回答了这一点,这样你就可以结束这个问题(这将节省时间给那些花时间潜行寻找开放性问题的人)。。。你知道,我做了什么?我每次都手动修补Django,将“autoclobber”设置为True。谢谢这应该记录在Django文档中的某个地方,如果还没有的话。“这应该记录在某个地方……”——似乎现在已经记录了,但只记录在这里。另外,显然没有记录的事实是,
--noinput
与testserver命令一起工作,例如,
manage.py testserver--noinput my_fixture.json
它现在已被记录(此时在开发文档中)。