简体   繁体   中英

How to automatically destroy django test database

I'm currently trying to automate django tests using hudson, and am struggling to find an option that will automatically destroy the test database if it already exists (typically it will ask for confirmation to destroy it, which the automatic testing obviously cannot provide for).

Any suggestions would be much appreciated!

Cheers, R

Use --help to see the docs of the test command:

>>> ./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.

And use --noinput which defaults to destroying the test db;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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