2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-24 00:01:54 +00:00

all tests working except for git troggle and survex parsing

This commit is contained in:
Philip Sargent 2024-07-04 22:36:40 +03:00
parent 57bab53cec
commit 69ce1d91f3
2 changed files with 6 additions and 12 deletions

View File

@ -85,8 +85,10 @@ class PageTests(TestCase):
def test_expoweb_dir_no_index(self):
response = self.client.get("/handbook/troggle")
content = response.content.decode()
# with open('testresponse.html','w') as tr:
# tr.writelines(content)
self.assertEqual(response.status_code, HTTPStatus.NOT_FOUND)
ph = r"Page not found handbook/troggle/index.html"
ph = r"Page not found 'handbook/troggle/index.html'"
phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")
@ -170,7 +172,7 @@ class PageTests(TestCase):
response = self.client.get("/1234/115.htm")
self.assertEqual(response.status_code, HTTPStatus.NOT_FOUND)
content = response.content.decode()
ph = r"Page not found 1234/115.htm"
ph = r"Page not found '1234/115.htm'"
phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")
@ -190,7 +192,7 @@ class PageTests(TestCase):
content = response.content.decode()
ph = r"115"
phmatch = re.search(ph, content)
self.assertIsNone(phmatch, "Failed to find expected text: '" + ph + "'")
self.assertIsNone(phmatch, "Unexpectedly found unexpected text: '" + ph + "'")
def test_page_ss(self):
response = self.client.get("/survey_scans/")
@ -406,7 +408,7 @@ class PageTests(TestCase):
response = self.client.get("/photos/2018/PhilipSargent/_corin.jpeg") # does not exist
self.assertEqual(response.status_code, HTTPStatus.NOT_FOUND)
content = response.content.decode()
ph = r"<title>Page not found 2018/PhilipSargent/_corin.jpeg</title>"
ph = r"<title>Page not found '2018/PhilipSargent/_corin.jpeg'</title>"
phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")

View File

@ -1,8 +0,0 @@
[
{"pk": 9010, "model": "auth.user", "fields":
{"username": "expotest", "first_name": "ExpoTest", "last_name": "Caver", "is_active": true, "is_superuser": false, "is_staff": false, "last_login": "2021-02-01 00:00:00+0100", "groups": [], "user_permissions": [], "password": "pbkdf2_sha256$150000$I9wNXhHCAaHo$0ncTIJ7G+3bSaKHg7RD3ZG2a/4v7cG1bjovq9BiCyA4=", "email": "philip.sargent+expo@gmail.com", "date_joined": "2021-02-01 00:00:00+0100"}},
{"pk": 9011, "model": "auth.user", "fields":
{"username": "expotestadmin", "first_name": "ExpoTest", "last_name": "Admin", "is_active": true, "is_superuser": true, "is_staff": true, "last_login": "2021-02-01 00:00:00+0100", "groups": [], "user_permissions": [], "password": "pbkdf2_sha256$150000$I9wNXhHCAaHo$0ncTIJ7G+3bSaKHg7RD3ZG2a/4v7cG1bjovq9BiCyA4=", "email": "philip.sargent+expoadmin@gmail.com", "date_joined": "2021-02-01 00:00:00+0100"}}
]