Update tests/test_utils_sendmail.py
Run CI Tests / test (push) Successful in 1m41s

This commit is contained in:
2025-08-12 22:33:45 +02:00
parent a9e85ebb1f
commit dce49b1851
+7
View File
@@ -50,6 +50,13 @@ def test_sendmail_local_delivery():
assert subject in content, "Email subject not found in delivered message"
assert body in content, "Email body not found in delivered message"
repr_str = repr(msg)
assert isinstance(repr_str, str), "__repr__() must return str"
assert f"To: {to_addr}" in repr_str, "To header missing from __repr__()"
assert f"From: {from_addr}" in repr_str, "From header missing from __repr__()"
assert f"Subject: {subject}" in repr_str, "Subject header missing from __repr__()"
assert body in repr_str, "Body missing from __repr__()"
def test_sendmail_raises_on_sendmail_failure(monkeypatch):
# Fake CompletedProcess-like object with a failing return code
class FakeResult: