diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2022-03-18 20:00:15 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2022-03-18 20:00:15 +0000 |
commit | 6a18511dd0aaa514ef480cc626f60765b76d58dd (patch) | |
tree | c0f107e7e29818248284649f7cc26f62b9076a4b /core/TESTS/tests.py | |
parent | 6f32364675fa413db942486d8efccd4d0990e274 (diff) | |
download | troggle-6a18511dd0aaa514ef480cc626f60765b76d58dd.tar.gz troggle-6a18511dd0aaa514ef480cc626f60765b76d58dd.tar.bz2 troggle-6a18511dd0aaa514ef480cc626f60765b76d58dd.zip |
Fixing URLs for cave descriptions
Diffstat (limited to 'core/TESTS/tests.py')
-rw-r--r-- | core/TESTS/tests.py | 22 |
1 files changed, 19 insertions, 3 deletions
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) |