Create endpoint to show password recovery email content and update email template (#664)

This commit is contained in:
Alejandra
2024-03-10 00:53:46 +01:00
committed by GitHub
parent 449889b994
commit f5ccd4a59c
5 changed files with 41 additions and 15 deletions

View File

@@ -1,3 +1,4 @@
from app.utils import generate_password_reset_token
from fastapi.testclient import TestClient
from app.core.config import settings
@@ -64,13 +65,7 @@ def test_recovery_password_user_not_exits(
def test_reset_password(
client: TestClient, superuser_token_headers: dict[str, str]
) -> None:
login_data = {
"username": settings.FIRST_SUPERUSER,
"password": settings.FIRST_SUPERUSER_PASSWORD,
}
r = client.post(f"{settings.API_V1_STR}/login/access-token", data=login_data)
token = r.json().get("access_token")
token = generate_password_reset_token(email=settings.FIRST_SUPERUSER)
data = {"new_password": "changethis", "token": token}
r = client.post(
f"{settings.API_V1_STR}/reset-password/",