2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-16 08:27:12 +00:00

still working on tests

This commit is contained in:
2023-11-22 18:58:19 +00:00
parent a63f04d194
commit 32e487eca6
2 changed files with 13 additions and 8 deletions

View File

@@ -158,7 +158,12 @@ class FixturePageTests(TestCase):
"""Expect to get Page Not Found and status 404"""
ph = self.ph
ph = "Probably a mistake."
response = self.client.get("/1623/115")
response = self.client.get("/1623/115/115")
# content = response.content.decode()
# with open('_test_bare_url115.html', 'w') as f:
# f.write(content)
self.assertEqual(response.status_code, HTTPStatus.NOT_FOUND)
content = response.content.decode()
@@ -170,11 +175,11 @@ class FixturePageTests(TestCase):
ph = self.ph
ph = "Probably a mistake."
response = self.client.get("/1623-115")
self.assertEqual(response.status_code, HTTPStatus.NOT_FOUND)
self.assertEqual(response.status_code, HTTPStatus.FOUND) # 302 redirected
content = response.content.decode()
phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'") # 200 & Page Not Found
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'") # 302 & Page Not Found
def test_fix_caves284(self):
response = self.client.get("/caves")