Files
notifications-admin/tests/app/main/test_errorhandlers.py
Chris Hill-Scott f3b0c0a556 Use client and logged_in_client fixtures
Wherever possible, because Don’t Repeat Yourself.
2017-02-06 10:44:38 +00:00

10 lines
318 B
Python

from bs4 import BeautifulSoup
from flask import url_for
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'