aboutsummaryrefslogtreecommitdiff
path: root/tests/test_moderation_policy.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/test_moderation_policy.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_moderation_policy.py b/tests/test_moderation_policy.py
index 48a34ac..3421ba5 100644
--- a/tests/test_moderation_policy.py
+++ b/tests/test_moderation_policy.py
@@ -60,3 +60,8 @@ def test_allowlist_is_fail_closed_and_blocklist_takes_precedence(app: Flask) ->
== "Source domain is blocked"
)
assert rejection_reason("https://example.org/post") is None
+
+
+def test_rejection_reason_reports_invalid_source_hostname(app: Flask) -> None:
+ with app.app_context():
+ assert rejection_reason("http://[not-an-ip") == "Invalid source hostname"