You need to recreate the environment and run a test rqworker, as is done in manage.py test
.
The important thing to remember is that the rqworker needs to run with SECUREDROP_ENV=test
because it loads the config and runs some Python code independently of the test runner.
My preferred way to do this is:
vagrant up development
vagrant ssh
tmux # so you can monitor the output of rqworker for errors. You could also run it in the background.
# Split your tmux panes
# In Pane 1, run the "test" rqworker.
SECUREDROP_ENV=test rqworker test -P /vagrant/securedrop/
# In Pane 2, run py.test. You can now pass any flags you want to py.test to take advantage of all of its sweet features.
SECUREDROP_ENV=test py.test -v