I am running Django unit tests against a multithreaded app. Often a thread hasn't terminated by the time the unit test finishes, so the test database cannot be deleted. When I next run the tests, I get the message:
Type 'yes' if you would like to try deleting the test database 'test_appname', or 'no' to cancel`
The create_test_db
autoclobber
option is the functionality I want, but how can I use that? I can't find any examples or clues. I'm working in the PyCharm IDE, which is pretty configurable. I just want to delete the test database silently every time.
I'm putting tests in Transaction TestCase
classes, running setup_test_environment()
then Client().post(reverse(etc..))..
In Pycharm django tests, you can enable the option input and enter --noinput
see screenshot below
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With