Skip to content
Snippets Groups Projects

Perform password validation in UpdateUser

Merged Valentin Rigal requested to merge reset-pwd-validation into master
1 file
+ 16
0
Compare changes
  • Side-by-side
  • Inline
@@ -64,6 +64,22 @@ class TestRegistration(FixtureAPITestCase):
)
self.assertEqual(response.status_code, status.HTTP_200_OK)
def test_update_password_validation(self):
self.client.force_login(self.user)
response = self.client.patch(
reverse("api:user-retrieve"),
data={"password": "email"},
format="json",
)
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertDictEqual(response.json(), {
"password": [
"The password is too similar to the email address.",
"This password is too short. It must contain at least 8 characters.",
"This password is too common.",
]
})
def test_update_display_name(self):
self.client.force_login(self.user)
response = self.client.patch(
Loading