From 779d10051556242ba1e70b70f6c6e8f1158e861d Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Sun, 22 Nov 2026 11:11:23 +0100 Subject: feat(receiver)!: enrich digest notification emails Render plain-text digests with source, target, per-Webmention detail links, and a filtered dashboard link while preserving singular and plural wording. Freeze the notified rows before sending so mentions arriving during delivery are left for the next digest. BREAKING CHANGE: enabling `DIGEST_EMAIL` now requires `SERVER_NAME` so background workers can generate absolute administration URLs. --- tests/test_config.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'tests/test_config.py') diff --git a/tests/test_config.py b/tests/test_config.py index 43c29ab..fedd7ce 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -39,6 +39,39 @@ def test_session_cookie_defaults( assert config_class.SESSION_COOKIE_SAMESITE == "Lax" +def test_testing_config_preserves_default_request_host() -> None: + app = create_app(TestingConfig) + assert app.config["SERVER_NAME"] is None + assert app.config["PREFERRED_URL_SCHEME"] == "http" + + +def test_digest_requires_server_name_at_app_startup() -> None: + class MissingServerNameConfig(TestingConfig): + DIGEST_EMAIL = "owner@example.com" + SERVER_NAME = None + + with pytest.raises(RuntimeError, match="Configure SERVER_NAME"): + create_app(MissingServerNameConfig) + + +def test_digest_rejects_blank_server_name() -> None: + class BlankServerNameConfig(TestingConfig): + DIGEST_EMAIL = "owner@example.com" + SERVER_NAME = " " + + with pytest.raises(RuntimeError, match="Configure SERVER_NAME"): + create_app(BlankServerNameConfig) + + +def test_server_name_optional_when_digest_disabled() -> None: + class NoDigestConfig(TestingConfig): + DIGEST_EMAIL = None + SERVER_NAME = None + + app = create_app(NoDigestConfig) + assert app.config["SERVER_NAME"] is None + + def test_source_allowlist_mode_requires_boolean_configuration(tmp_path: Path) -> None: class BadSourceModeConfig(TestingConfig): LOG_FILE = str(tmp_path / "mode-test.log") -- cgit v1.3.1