add check for status codes

When there is a 404 then there wouldn't be a "Novartis" string present so the
test would still pass.
This commit is contained in:
Andreas Zweili 2019-08-07 22:48:38 +02:00
parent 00725cec8a
commit 3daf05a5c3
1 changed files with 2 additions and 1 deletions

View File

@ -23,7 +23,8 @@ def test_customer_list_view_no_customer(create_admin_user):
client = Client()
client.login(username="novartis-admin", password="password")
response = client.get('/')
assert "Novartis" not in response.content.decode('utf8')
assert (response.status_code == 200
and "Novartis" not in response.content.decode('utf8'))
@pytest.mark.django_db