Against staging:
MyListsTest
.create_pre_authenticated_session .management.commands.create_session
.create_pre_authenticated_session
|
\|/ /|\
|
server_tools
.create_session_on_server run manage.py create_session
| /|\
\|/ |
subprocess.check_output --> fab --> fabfile.create_session_on_server
Anyway, let’s see if it works. First, locally, to check we didn’t break anything:
$
python3 manage.py test functional_tests.test_my_lists
[...]
OK
Next, against the server. We push our code up first:
$
git push
# you'll need to commit changes first.
$
cd deploy_tools
$
fab deploy --host=superlists-staging.ottg.eu
And now we run the test—notice we can include
elspeth@
in the specification of the
liveserver
argument now:
$
python3 manage.py test functional_tests.test_my_lists \
-
-liveserver=elspeth@superlists-staging.ottg.euCreating test database for alias 'default'...
[superlists-staging.ottg.eu] Executing task 'reset_database'
~/sites/superlists-staging.ottg.eu/source/manage.py flush --noinput
[superlists-staging.ottg.eu] out: Syncing...
[superlists-staging.ottg.eu] out: Creating tables ...
[...]
.
---------------------------------------------------------------------
Ran 1 test in 25.701s
OK
Looking good! We can rerun all the tests to make sure…
$
python3 manage.py test functional_tests \
-
-liveserver=elspeth@superlists-staging.ottg.euCreating test database for alias 'default'...
[superlists-staging.ottg.eu] Executing task 'reset_database'
[...]
Ran 7 tests in 89.494s
316
|
Chapter 17: Test Fixtures, Logging, and Server-Side Debugging