From dcfff1ede7d33c91a87f4874181156b46ec75589 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Thu, 6 Apr 2023 00:16:44 +0100 Subject: [PATCH] tests for QM pages --- core/TESTS/test_caves.py | 18 ++++++++++++++++++ core/TESTS/test_urls.py | 1 + 2 files changed, 19 insertions(+) diff --git a/core/TESTS/test_caves.py b/core/TESTS/test_caves.py index baa4ffa..e35d360 100644 --- a/core/TESTS/test_caves.py +++ b/core/TESTS/test_caves.py @@ -175,3 +175,21 @@ class FixturePageTests(TestCase): content = response.content.decode() phmatch = re.search(ph, content) self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'") # 200 & Page Not Found + + def test_fix_qms(self): + response = self.client.get("/cave/qms/1623-284") + self.assertEqual(response.status_code, HTTPStatus.OK) + content = response.content.decode() + ph = r"Question marks for 284 - Seetrichter" + phmatch = re.search(ph, content) + self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'") + + def test_fix_openqms(self): + response = self.client.get("/cave/openqms/1623-284") + self.assertEqual(response.status_code, HTTPStatus.OK) + content = response.content.decode() + ph = r"Open Leads for 284 - Seetrichter" + phmatch = re.search(ph, content) + self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'") + + diff --git a/core/TESTS/test_urls.py b/core/TESTS/test_urls.py index 7af8efc..d796cde 100644 --- a/core/TESTS/test_urls.py +++ b/core/TESTS/test_urls.py @@ -52,6 +52,7 @@ Tests exist: 2. With parameter {% url "caveQMs" "1623-290" %} +{% url "cave_openQMs" "1623-290" %} {% url "cavewallets" cave_id %} {% url "dwgfilesingle" drawing.dwgpath %} {% url "edit_cave" cave.url_parent cave.slug %}