first setup configuration
Build LinkLog Development Image / development-image (push) Successful in 10s

This commit is contained in:
Olaf
2026-08-25 22:51:17 +02:00
parent 07e520e03f
commit defe7a83a9
10 changed files with 254 additions and 44 deletions
+16 -2
View File
@@ -3,7 +3,7 @@
from unittest.mock import patch
from backend.app.services.email_service import send_verification_email
from backend.app.services.email_service import send_test_email, send_verification_email
def test_send_verification_email_uses_smtp_settings(monkeypatch):
@@ -25,4 +25,18 @@ def test_send_verification_email_uses_smtp_settings(monkeypatch):
smtp.login.assert_called_once_with('mailer', 'secret')
message = smtp.send_message.call_args.args[0]
assert message['To'] == 'user@example.com'
assert 'https://linklog.example/verify' in message.get_content()
assert 'https://linklog.example/verify' in message.get_content()
def test_send_test_email_uses_configured_recipient(monkeypatch):
from backend.app.core.config import settings
monkeypatch.setattr(settings, 'smtp_host', 'smtp.example.com')
monkeypatch.setattr(settings, 'smtp_from', 'LinkLog <no-reply@example.com>')
with patch('backend.app.services.email_service.SMTP') as smtp_class:
smtp = smtp_class.return_value.__enter__.return_value
send_test_email('admin@example.com')
message = smtp.send_message.call_args.args[0]
assert message['To'] == 'admin@example.com'
assert message['Subject'] == 'LinkLog SMTP test'