Skip to content
Snippets Groups Projects
Commit 86b1b64b authored by Valentin Rigal's avatar Valentin Rigal
Browse files

Add test case

parent 443509ca
No related branches found
No related tags found
1 merge request!2325Perform password validation in UpdateUser
This commit is part of merge request !2325. Comments created here will be created in the context of that merge request.
......@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment