Add some basic 200 OK smoke tests for key pages

This commit is contained in:
Ben Sturmfels 2024-05-10 12:12:04 +10:00
parent 0b8ae2ca77
commit 97b60b44f5
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0
2 changed files with 16 additions and 1 deletions

View file

@ -5,11 +5,11 @@
* ask Denver about why so many license files
* serve a 400 in Apache for a hostname we don't explicitly support
* replace `internalNavigate` with inline flexbox layout
* add tests for main pages returning 200
# Done
* add tests for main pages returning 200
* move `SITE_FUNDGOAL` configuration to `settings.py`
* move `sponsors.py` and `sponsors.html` into `supporters` app
* use `<detail>` elements for supporter page hidden sections, rather than

View file

@ -19,7 +19,22 @@ def create_fundraising_goal():
fundraiser_endtime=datetime.datetime(2000, 1, 1)
)
# Simple smoke tests to make sure the essential pages on the site are working.
get_200_ok_test_data = [
'/',
'/news/',
'/blog/',
'/sustainer/',
]
@pytest.mark.parametrize('url', get_200_ok_test_data)
@pytest.mark.django_db
def test_get_200_ok(url, client):
response = client.get(url)
assert response.status_code == 200
# Tests for the template/file content serving functionality.
@pytest.mark.django_db
def test_about_page_served(rf):
create_fundraising_goal()