2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-17 04:57:03 +00:00

tidy trailing slash everywhere & fix tests

This commit is contained in:
2025-02-19 16:00:53 +02:00
parent cc06e2e1f4
commit a950cc60d9
14 changed files with 141 additions and 49 deletions

View File

@@ -187,7 +187,7 @@ class PostTests(TestCase):
with open("core/fixtures/test_upload_file.txt", "r") as testf:
response = self.client.post(
"/photoupload/", data={"name": "test_upload_file.txt", "renameto": "", "uploadfiles": testf}
"/photoupload", data={"name": "test_upload_file.txt", "renameto": "", "uploadfiles": testf}
)
content = response.content.decode()
self.assertEqual(response.status_code, HTTPStatus.OK)
@@ -224,7 +224,7 @@ class PostTests(TestCase):
rename = "RENAMED-FILE.JPG"
with open("core/fixtures/test_upload_file.txt", "r") as testf:
response = self.client.post(
"/photoupload/", data={"name": "test_upload_file.txt", "renameto": rename, "uploadfiles": testf}
"/photoupload", data={"name": "test_upload_file.txt", "renameto": rename, "uploadfiles": testf}
)
content = response.content.decode()
self.assertEqual(response.status_code, HTTPStatus.OK)
@@ -255,11 +255,11 @@ class PostTests(TestCase):
self.assertTrue(u.is_active, "User '" + u.username + "' is INACTIVE")
c.login(username=u.username, password="secretword")
response = self.client.post("/photoupload/", data={"photographer": "GussieFinkNottle"})
response = self.client.post("/photoupload", data={"photographer": "GussieFinkNottle"})
content = response.content.decode()
self.assertEqual(response.status_code, HTTPStatus.OK)
# with open('_test_response.html', 'w') as f:
# f.write(content)
# f.write(content)
for ph in [r"Create new Photographer folder", r"/GussieFinkNottle/"]:
phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")