fix:deadlock und doppelte Mails
This commit is contained in:
1 parent
b1531e41e1
commit
8b6f74f364
13 files changed
+69
-27
No files matched your search
+6
-2
@@ -4,6 +4,7 @@ Passwort vergessen, Einladungen, Benachrichtigungen, Abmelden (CI)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import smtplib
|
||||
from datetime import UTC, datetime, timedelta
|
||||
from email.message import EmailMessage
|
||||
@@ -179,8 +180,11 @@ def test_forgot_password_answers_the_same(app: Any) -> None:
|
||||
known = forgot(new_client(app), "anna@example.de")
|
||||
unknown = forgot(new_client(app), "nobody@example.de")
|
||||
assert known.status_code == unknown.status_code == 200
|
||||
assert known.text.replace(csrf_from(known.text), "") == unknown.text.replace(
|
||||
csrf_from(unknown.text), "")
|
||||
# Seiten gleich bis auf den CSRF-Wert (Meta-Feld, jeder Besucher hat seinen eigenen)
|
||||
def without_token(html: str) -> str:
|
||||
return re.sub(r"[0-9a-f]{40,}", "", html)
|
||||
|
||||
assert without_token(known.text) == without_token(unknown.text)
|
||||
(mail,) = messages("password_reset")
|
||||
assert mail.recipient == "anna@example.de" and mail.status == "queued"
|
||||
text = content(mail)["text"]
|
||||
|
||||
Reference in new issue
Block a user