summaryrefslogtreecommitdiffstats
path: root/core/TESTS/test_logins.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2025-01-17 16:00:13 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2025-01-17 16:00:13 +0000
commit05c687b25362f600f6d0428f9f756717edeaa26c (patch)
tree5757f72ae89ac6d2fc93202306805fe1b95d5731 /core/TESTS/test_logins.py
parent919e02cee948cb7f6254eb89127bac33c16e01f6 (diff)
downloadtroggle-05c687b25362f600f6d0428f9f756717edeaa26c.tar.gz
troggle-05c687b25362f600f6d0428f9f756717edeaa26c.tar.bz2
troggle-05c687b25362f600f6d0428f9f756717edeaa26c.zip
tests needed who_am_i field for cookie id
Diffstat (limited to 'core/TESTS/test_logins.py')
-rw-r--r--core/TESTS/test_logins.py22
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",