2016-03-11 10:16:06 +00:00
|
|
|
from bs4 import BeautifulSoup
|
|
|
|
|
|
|
|
|
|
|
2017-02-03 12:07:21 +00:00
|
|
|
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'
|