Figure 8-3. The staging site is up!
Let’s see what our functional tests say:
$
python3 manage.py test functional_tests --liveserver=superlists-staging.ottg.eu
[...]
selenium.common.exceptions.NoSuchElementException: Message: 'Unable to locate
[...]
AssertionError: 0.0 != 512 within 3 delta
The tests are failing as soon as they try and submit a new item, because we haven’t set
up the database. You’ll probably have spotted the yellowDjango debug page
( Figure 8-4)
telling us as much as the tests went through, or if you tried it manually.
The tests saved us from potential embarrassment there. The site
looked
fine when we loaded its front page. If we’d been a little hasty,
we might have thought we were done, and it would have been the first
users that discovered that nasty Django DEBUG page. Okay, slight
exaggeration for effect, maybe we
would
have checked, but what hap‐
pens as the site gets bigger and more complex? You can’t check
everything. The tests can.
146
|
Chapter 8: Testing Deployment Using a Staging Site