From 441723f7f179360b4085dc015c052f2eaf5baa4f Mon Sep 17 00:00:00 2001 From: Sietse Snel Date: Thu, 19 Oct 2023 09:46:12 +0200 Subject: [PATCH] Add integration test activation long password --- yoda_eus/app.py | 2 +- yoda_eus/tests/test_integration.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/yoda_eus/app.py b/yoda_eus/app.py index 933ba71..5960706 100644 --- a/yoda_eus/app.py +++ b/yoda_eus/app.py @@ -126,7 +126,7 @@ def csrf_exempt(f): with app.app_context(): now = datetime.now() hashed_password = bcrypt.hashpw("Test123456!!!".encode("utf-8"), bcrypt.gensalt()) - for n in range(1, 5): + for n in range(1, 6): unactivated_user = User(username="unactivateduser" + str(n), creator_time=now, creator_user="creator", diff --git a/yoda_eus/tests/test_integration.py b/yoda_eus/tests/test_integration.py index 9f3a078..69abcc9 100644 --- a/yoda_eus/tests/test_integration.py +++ b/yoda_eus/tests/test_integration.py @@ -189,6 +189,10 @@ def test_activate_and_check_auth_interpunction2(self, test_client): def test_activate_and_check_auth_interpunction3(self, test_client): self._test_activate_and_check_auth(test_client, "Test1;:\"',./<>?", "unactivateduser4", "goodhash4") + def test_activate_and_check_auth_long_password(self, test_client): + long_password = "T1_" + "a" * 996 + self._test_activate_and_check_auth(test_client, long_password, "unactivateduser5", "goodhash5") + def test_auth_check_user_does_not_exist(self, test_client): bad_credentials = "userdoesnotexist:somepassword" bad_credentials_base64 = base64.b64encode(bad_credentials.encode('utf-8')).decode('utf-8')