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: Remove deprecated SHA1PasswordHasher.

Anders Kaseorg8843f9f62a33
diff --git a/zerver/tests/test_auth_backends.py b/zerver/tests/test_auth_backends.py
index efe2bc6bd30..e7164a4ceb4 100644
--- a/zerver/tests/test_auth_backends.py
+++ b/zerver/tests/test_auth_backends.py
@@ -367,15 +367,15 @@ class AuthBackendTest(ZulipTestCase):
user_profile = self.example_user("hamlet")
password = "a_password_of_22_chars"
- with self.settings(PASSWORD_HASHERS=("django.contrib.auth.hashers.SHA1PasswordHasher",)):
+ with self.settings(PASSWORD_HASHERS=("django.contrib.auth.hashers.MD5PasswordHasher",)):
user_profile.set_password(password)
user_profile.save()
with (
self.settings(
PASSWORD_HASHERS=(
+ "django.contrib.auth.hashers.PBKDF2PasswordHasher",
"django.contrib.auth.hashers.MD5PasswordHasher",
- "django.contrib.auth.hashers.SHA1PasswordHasher",
),
PASSWORD_MIN_LENGTH=30,
),
@@ -5040,15 +5040,15 @@ class FetchAPIKeyTest(ZulipTestCase):
user_profile = self.example_user("hamlet")
password = "a_password_of_22_chars"
- with self.settings(PASSWORD_HASHERS=("django.contrib.auth.hashers.SHA1PasswordHasher",)):
+ with self.settings(PASSWORD_HASHERS=("django.contrib.auth.hashers.MD5PasswordHasher",)):
user_profile.set_password(password)
user_profile.save()
with (
self.settings(
PASSWORD_HASHERS=(
+ "django.contrib.auth.hashers.PBKDF2PasswordHasher",
"django.contrib.auth.hashers.MD5PasswordHasher",
- "django.contrib.auth.hashers.SHA1PasswordHasher",
),
PASSWORD_MIN_LENGTH=30,
),
diff --git a/zerver/tests/test_signup.py b/zerver/tests/test_signup.py
index eb378417018..43d5696ba22 100644
--- a/zerver/tests/test_signup.py
+++ b/zerver/tests/test_signup.py
@@ -967,15 +967,15 @@ class LoginTest(ZulipTestCase):
user_profile = self.example_user("hamlet")
password = "a_password_of_22_chars"
- with self.settings(PASSWORD_HASHERS=("django.contrib.auth.hashers.SHA1PasswordHasher",)):
+ with self.settings(PASSWORD_HASHERS=("django.contrib.auth.hashers.MD5PasswordHasher",)):
user_profile.set_password(password)
user_profile.save()
with (
self.settings(
PASSWORD_HASHERS=(
+ "django.contrib.auth.hashers.PBKDF2PasswordHasher",
"django.contrib.auth.hashers.MD5PasswordHasher",
- "django.contrib.auth.hashers.SHA1PasswordHasher",
),
PASSWORD_MIN_LENGTH=30,
),
diff --git a/zproject/computed_settings.py b/zproject/computed_settings.py
index f8811836dac..18c39fc6a11 100644
--- a/zproject/computed_settings.py
+++ b/zproject/computed_settings.py
@@ -419,7 +419,6 @@ if DEVELOPMENT:
# PRODUCTION. Saves a bunch of time.
PASSWORD_HASHERS = [
"django.contrib.auth.hashers.MD5PasswordHasher",
- "django.contrib.auth.hashers.SHA1PasswordHasher",
"django.contrib.auth.hashers.PBKDF2PasswordHasher",
]
# Also we auto-generate passwords for the default users which you