You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's take the drop_db function from the manage.py module. I would not push this to production without a proper test. For what to test there are different opinions.
First, kind a "smoke test" - test for a 0 exit code.
Second, create a db via fixture, use the drop_db cli command, assert db is gone.
Third, if you like @sandimetz 's testing matrix (cf https://www.youtube.com/watch?v=URSWYvyc42M ), and you do not want to test outgoing commands (ie the db.drop_all() call), you'd have to create a mock and assert db.drop_all was called.
https://www.reddit.com/r/flask/comments/89f6by/af_how_do_i_test_my_cli_scripts/
The text was updated successfully, but these errors were encountered: