add some functional tests for our sanity checks

This commit is contained in:
Brian S. Stephan 2021-02-20 17:47:36 -06:00
parent 2e0e87fe95
commit 6026c51490
1 changed files with 12 additions and 0 deletions

View File

@ -15,6 +15,18 @@ def test_page_that_doesnt_exist(client):
assert response.status_code == 404
def test_files_outside_pages_do_not_get_served(client):
"""Test that page pathing doesn't break out of the instance/pages/ dir."""
response = client.get('/../unreachable')
assert response.status_code == 400
def test_weird_paths_do_not_get_served(client):
"""Test that we clean up requests as desired."""
response = client.get('/../../')
assert response.status_code == 400
def test_page_with_title_metadata(client):
"""Test that a page with title metadata has its title written."""
response = client.get('/')