Use client and logged_in_client fixtures

Wherever possible, because Don’t Repeat Yourself.
This commit is contained in:
Chris Hill-Scott
2017-02-03 12:07:21 +00:00
parent 929dc45224
commit f3b0c0a556
32 changed files with 2389 additions and 2897 deletions

View File

@@ -2,9 +2,8 @@ from bs4 import BeautifulSoup
from flask import url_for
def test_bad_url_returns_page_not_found(app_):
with app_.test_client() as client:
response = client.get('/bad_url')
assert response.status_code == 404
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert page.h1.string.strip() == 'Page could not be found'
def test_bad_url_returns_page_not_found(client):
response = client.get('/bad_url')
assert response.status_code == 404
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert page.h1.string.strip() == 'Page could not be found'