From 97b60b44f50dbc56c3ac06211ca4ea64b133be38 Mon Sep 17 00:00:00 2001 From: Ben Sturmfels Date: Fri, 10 May 2024 12:12:04 +1000 Subject: [PATCH] Add some basic 200 OK smoke tests for key pages --- TODO.md | 2 +- conservancy/tests.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index c58eba5c..8cee694f 100644 --- a/TODO.md +++ b/TODO.md @@ -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 `` elements for supporter page hidden sections, rather than diff --git a/conservancy/tests.py b/conservancy/tests.py index eb8b17da..3016821a 100644 --- a/conservancy/tests.py +++ b/conservancy/tests.py @@ -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()