diff options
-rw-r--r-- | core/TESTS/test_logins.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/core/TESTS/test_logins.py b/core/TESTS/test_logins.py index 80802ca..1a153d2 100644 --- a/core/TESTS/test_logins.py +++ b/core/TESTS/test_logins.py @@ -3,6 +3,9 @@ Originally written for CUYC Philip Sargent (Feb.2021) Modified for Expo April 2021. + +To run just these, do +uv run manage.py test -v 3 troggle.core.TESTS.test_logins """ import pathlib @@ -146,11 +149,11 @@ class PostTests(TestCase): with open("core/fixtures/test_upload_file.txt", "r") as testf: response = self.client.post( - f"/walletedit/{testyear}:00", data={"name": "test_upload_file.txt", "uploadfiles": testf} + f"/walletedit/{testyear}:00", data={"name": "test_upload_file.txt", "uploadfiles": testf, "who_are_you": "Gumby <gumby@tent.expo>"} ) content = response.content.decode() self.assertEqual(response.status_code, HTTPStatus.OK) - # with open("_test_response.html", "w") as f: + # with open('_test_response__scan_upload.html', 'w') as f: # f.write(content) for ph in [ r"test_upload_", @@ -189,8 +192,8 @@ class PostTests(TestCase): content = response.content.decode() self.assertEqual(response.status_code, HTTPStatus.OK) self.assertEqual(response.status_code, HTTPStatus.OK) - with open('_test_response.html', 'w') as f: - f.write(content) + # with open('_test_response_photo_upload.html', 'w') as f: + # f.write(content) for ph in [ r"test_upload_", r"Upload photos into /photos/" + str(current_year), @@ -281,13 +284,16 @@ class PostTests(TestCase): with open("core/fixtures/test_upload_file.pdf", "r") as testf: response = self.client.post( - "/dwgupload/uploads", data={"name": "test_upload_file.txt", "uploadfiles": testf} + "/dwgupload/uploads", data={"name": "test_upload_file.txt", "uploadfiles": testf, "who_are_you": "Gumby <gumby@tent.expo>"} ) content = response.content.decode() + # with open('_test_response_dwg_upload_txt.html', 'w') as f: + # f.write(content) self.assertEqual(response.status_code, HTTPStatus.OK) t = re.search("Files refused:", content) self.assertIsNotNone(t, 'Logged in but failed to see "Files refused:"') + def test_dwg_upload_drawing(self): """Expect no-suffix file to upload Note that this skips the git commit process. That would need a new test. @@ -302,11 +308,11 @@ class PostTests(TestCase): with open("core/fixtures/test_upload_nosuffix", "r") as testf: response = self.client.post( - "/dwguploadnogit/uploads", data={"name": "test_upload_nosuffix", "uploadfiles": testf} + "/dwguploadnogit/uploads", data={"name": "test_upload_nosuffix", "uploadfiles": testf, "who_are_you": "Gumby <gumby@tent.expo>"} ) content = response.content.decode() - # with open('_test_response.html', 'w') as f: - # f.write(content) + # with open('_test_response_dwg_upload_drawing.html', 'w') as f: + # f.write(content) self.assertEqual(response.status_code, HTTPStatus.OK) for ph in [ r"test_upload_nosuffix", |