forked from fastapi/full-stack-fastapi-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Refactor email logic to allow re-using util functions for testing …
…and development (fastapi#663)
- Loading branch information
Showing
8 changed files
with
102 additions
and
70 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
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 |
---|---|---|
|
@@ -39,8 +39,8 @@ def test_use_access_token( | |
def test_recovery_password( | ||
client: TestClient, normal_user_token_headers: dict[str, str], mocker | ||
) -> None: | ||
mocker.patch("app.utils.send_reset_password_email", return_value=None) | ||
mocker.patch("app.utils.send_email", return_value=None) | ||
mocker.patch("app.core.config.settings.EMAILS_ENABLED", True) | ||
email = "[email protected]" | ||
r = client.post( | ||
f"{settings.API_V1_STR}/password-recovery/{email}", | ||
|
@@ -75,7 +75,7 @@ def test_reset_password( | |
r = client.post( | ||
f"{settings.API_V1_STR}/reset-password/", | ||
headers=superuser_token_headers, | ||
json=data | ||
json=data, | ||
) | ||
assert r.status_code == 200 | ||
assert r.json() == {"message": "Password updated successfully"} | ||
|
@@ -88,7 +88,7 @@ def test_reset_password_invalid_token( | |
r = client.post( | ||
f"{settings.API_V1_STR}/reset-password/", | ||
headers=superuser_token_headers, | ||
json=data | ||
json=data, | ||
) | ||
response = r.json() | ||
|
||
|
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
Oops, something went wrong.