-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Description Please explain the changes you made here. ### Checklist - [ ] Created tests which fail without the change (if possible) - [ ] All tests passing - [ ] Extended the documentation, if necessary
- Loading branch information
Showing
3 changed files
with
3 additions
and
35 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
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 |
---|---|---|
|
@@ -258,29 +258,6 @@ def test_update_user(client: TestClient) -> None: | |
assert response.status_code == 204 | ||
|
||
|
||
async def test_invalid_migrate_mail(client: TestClient) -> None: | ||
student_user_with_old_email_token = create_api_access_token( | ||
student_user_with_old_email, | ||
) | ||
other_student_user_token = create_api_access_token(student_user) | ||
|
||
# Invalid old mail format | ||
response = client.post( | ||
"/users/migrate-mail", | ||
json={"new_email": "[email protected]"}, | ||
headers={"Authorization": f"Bearer {other_student_user_token}"}, | ||
) | ||
assert response.status_code == 400 | ||
|
||
# Invalid new mail format | ||
response = client.post( | ||
"/users/migrate-mail", | ||
json={"new_email": "[email protected]"}, | ||
headers={"Authorization": f"Bearer {student_user_with_old_email_token}"}, | ||
) | ||
assert response.status_code == 400 | ||
|
||
|
||
async def test_migrate_mail(mocker: MockerFixture, client: TestClient) -> None: | ||
# NOTE: we don't want to mock app.core.security.generate_token but | ||
# app.core.users.endpoints_users.security.generate_token which is the imported version of the function | ||
|