From 6a18511dd0aaa514ef480cc626f60765b76d58dd Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Fri, 18 Mar 2022 20:00:15 +0000 Subject: Fixing URLs for cave descriptions --- core/TESTS/tests.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'core/TESTS/tests.py') diff --git a/core/TESTS/tests.py b/core/TESTS/tests.py index 4af5fa0..64dda9b 100644 --- a/core/TESTS/tests.py +++ b/core/TESTS/tests.py @@ -158,14 +158,30 @@ class PageTests(TestCase): self.assertEqual(len(response.content), 6057) def test_cave_kataster_not_found(self): - # database not loaded, so no caves found - response = self.client.get('/cave/115') + # database not loaded, so no caves found; so looks for a generic expopage and fails + response = self.client.get('/1623/115.htm') + self.assertEqual(response.status_code, 404) + content = response.content.decode() + ph = r"Page not found 1623/115.htm" + phmatch = re.search(ph, content) + self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph +"'") + + def test_caves_page(self): + response = self.client.get('/caves') self.assertEqual(response.status_code, 200) content = response.content.decode() - ph = r"Cave Identifier not found in database" + ph = r"Cave Number Index - kept updated" phmatch = re.search(ph, content) self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph +"'") + def test_caves_page_kataster_not_found(self): + response = self.client.get('/caves') + self.assertEqual(response.status_code, 200) + content = response.content.decode() + ph = r"115" + phmatch = re.search(ph, content) + self.assertIsNone(phmatch, "Failed to find expected text: '" + ph +"'") + def test_page_ss(self): response = self.client.get('/survey_scans/') self.assertEqual(response.status_code, 200) -- cgit v1.2.3