-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
return a 400 Bad request when trying to change the username to an exi…
…sting one
- Loading branch information
Showing
2 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1714,6 +1714,12 @@ def test_manager_changes_email_to_existing_when_login_with_email(self): | |
}, | ||
) | ||
self.assertFalse(email_change_response.ok) | ||
self.assertEqual(email_change_response.status_code, 400) | ||
email_change_response_json = email_change_response.json() | ||
self.assertEqual( | ||
email_change_response_json.get("error", {}).get("message"), | ||
"Cannot update login name of user to '[email protected]'.", | ||
) | ||
|
||
# Email was not changed, so log in with the old one | ||
new_login_with_old_email_response = self.anon_api_session.post( | ||
|
@@ -1777,7 +1783,12 @@ def test_user_changes_email_to_existing_one_when_login_with_email(self): | |
json={"email": "[email protected]"}, | ||
) | ||
|
||
self.assertFalse(email_change_response.ok) | ||
self.assertEqual(email_change_response.status_code, 400) | ||
email_change_response_json = email_change_response.json() | ||
self.assertEqual( | ||
email_change_response_json.get("error", {}).get("message"), | ||
"Cannot update login name of user to '[email protected]'.", | ||
) | ||
|
||
# email was not changed, so log in with the old one | ||
new_login_with_old_email_response = self.anon_api_session.post( | ||
|