From 857b4c580948cc748a09f968f030e4da2f3f00de Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Thu, 23 Nov 2023 11:19:05 +0000 Subject: [PATCH] repairing tests --- core/TESTS/test_caves.py | 9 ++++++--- core/TESTS/tests.py | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/core/TESTS/test_caves.py b/core/TESTS/test_caves.py index d86104ff8..e80d5b486 100644 --- a/core/TESTS/test_caves.py +++ b/core/TESTS/test_caves.py @@ -171,11 +171,14 @@ class FixturePageTests(TestCase): self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'") # 200 & Page Not Found def test_fix_cave_slug115(self): - """Expect to get Page Not Found and status 404""" + """Expect to get Page Not Found and status 404 + UPDATE THIS BACK to 1623-115 when the data is fixed so that we don't have the + internal redirections for cave ids""" ph = self.ph ph = "Probably a mistake." - response = self.client.get("/1623-115") - self.assertEqual(response.status_code, HTTPStatus.FOUND) # 302 redirected + # response = self.client.get("/1623-115") + response = self.client.get("/1234-123") + self.assertEqual(response.status_code, HTTPStatus.NOT_FOUND) content = response.content.decode() phmatch = re.search(ph, content) diff --git a/core/TESTS/tests.py b/core/TESTS/tests.py index d0cce7110..73fb0520c 100644 --- a/core/TESTS/tests.py +++ b/core/TESTS/tests.py @@ -165,10 +165,12 @@ class PageTests(TestCase): def test_cave_kataster_not_found(self): # database not loaded, so no caves found; so looks for a generic expopage and fails - response = self.client.get("/1623/115.htm") + # NEEDS TO BE REDONE AFETR cave id rewriting removed after the data is fixed in all teh cave description + # pages that link to photos + response = self.client.get("/1234/115.htm") self.assertEqual(response.status_code, HTTPStatus.NOT_FOUND) content = response.content.decode() - ph = r"Page not found 1623//115/115.htm" + ph = r"Page not found 1234/115.htm" phmatch = re.search(ph, content) self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")