more tests

This commit is contained in:
2023-04-06 00:51:04 +01:00
parent dcfff1ede7
commit f15555a3bd
5 changed files with 310 additions and 20 deletions

View File

@@ -118,8 +118,8 @@ class ImportTest(TestCase):
response = self.client.get("/survexfile/caves/")
self.assertEqual(response.status_code, HTTPStatus.OK)
content = response.content.decode()
with open('_test_response.html', 'w') as f:
f.write(content)
# with open('_test_response.html', 'w') as f:
# f.write(content)
ph = f"Caves with subdirectories"
phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")
@@ -130,8 +130,8 @@ class ImportTest(TestCase):
response = self.client.get("/people")
self.assertEqual(response.status_code, HTTPStatus.OK)
content = response.content.decode()
with open('_test_response.html', 'w') as f:
f.write(content)
# with open('_test_response.html', 'w') as f:
# f.write(content)
ph = f"<td><a href=\"/personexpedition/FredSmartarse/{TEST_YEAR}\">{TEST_YEAR}</a></td>"
phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")