Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

tests: Change password hashers used in tests that set them.

Mateusz Mandera98ec84eae2b0
diff --git a/zerver/tests/test_auth_backends.py b/zerver/tests/test_auth_backends.py
index 418dd7d793a..733ceb91a5a 100644
--- a/zerver/tests/test_auth_backends.py
+++ b/zerver/tests/test_auth_backends.py
@@ -346,14 +346,14 @@ class AuthBackendTest(ZulipTestCase):
user_profile = self.example_user("hamlet")
password = "a_password_of_22_chars"
- with self.settings(PASSWORD_HASHERS=("django.contrib.auth.hashers.PBKDF2PasswordHasher",)):
+ with self.settings(PASSWORD_HASHERS=("django.contrib.auth.hashers.SHA1PasswordHasher",)):
user_profile.set_password(password)
user_profile.save()
with self.settings(
PASSWORD_HASHERS=(
- "django.contrib.auth.hashers.Argon2PasswordHasher",
- "django.contrib.auth.hashers.PBKDF2PasswordHasher",
+ "django.contrib.auth.hashers.MD5PasswordHasher",
+ "django.contrib.auth.hashers.SHA1PasswordHasher",
),
PASSWORD_MIN_LENGTH=30,
), self.assertLogs("zulip.auth.email", level="INFO"), self.assertRaises(JsonableError) as m:
@@ -3935,14 +3935,14 @@ class FetchAPIKeyTest(ZulipTestCase):
user_profile = self.example_user("hamlet")
password = "a_password_of_22_chars"
- with self.settings(PASSWORD_HASHERS=("django.contrib.auth.hashers.PBKDF2PasswordHasher",)):
+ with self.settings(PASSWORD_HASHERS=("django.contrib.auth.hashers.SHA1PasswordHasher",)):
user_profile.set_password(password)
user_profile.save()
with self.settings(
PASSWORD_HASHERS=(
- "django.contrib.auth.hashers.Argon2PasswordHasher",
- "django.contrib.auth.hashers.PBKDF2PasswordHasher",
+ "django.contrib.auth.hashers.MD5PasswordHasher",
+ "django.contrib.auth.hashers.SHA1PasswordHasher",
),
PASSWORD_MIN_LENGTH=30,
), self.assertLogs("zulip.auth.email", level="INFO"):
diff --git a/zerver/tests/test_signup.py b/zerver/tests/test_signup.py
index acbadc6ad12..9345d2610d6 100644
--- a/zerver/tests/test_signup.py
+++ b/zerver/tests/test_signup.py
@@ -710,14 +710,14 @@ class LoginTest(ZulipTestCase):
user_profile = self.example_user("hamlet")
password = "a_password_of_22_chars"
- with self.settings(PASSWORD_HASHERS=("django.contrib.auth.hashers.PBKDF2PasswordHasher",)):
+ with self.settings(PASSWORD_HASHERS=("django.contrib.auth.hashers.SHA1PasswordHasher",)):
user_profile.set_password(password)
user_profile.save()
with self.settings(
PASSWORD_HASHERS=(
- "django.contrib.auth.hashers.Argon2PasswordHasher",
- "django.contrib.auth.hashers.PBKDF2PasswordHasher",
+ "django.contrib.auth.hashers.MD5PasswordHasher",
+ "django.contrib.auth.hashers.SHA1PasswordHasher",
),
PASSWORD_MIN_LENGTH=30,
), self.assertLogs("zulip.auth.email", level="INFO"):