diff options
| author | Dennis Fink | 2026-11-17 22:10:40 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-17 22:10:40 +0100 |
| commit | 63af533d98aac82b6d4f069b217d3e837285508d (patch) | |
| tree | 4ac11960f9676d3bb5a6f62204ef139862734209 /tests/forms/test_validators.py | |
| parent | acd1f42847786963fc4aaeed884c3091700c9e35 (diff) | |
| download | webmentions-ssg-63af533d98aac82b6d4f069b217d3e837285508d.tar.gz webmentions-ssg-63af533d98aac82b6d4f069b217d3e837285508d.zip | |
feat(receiver): explain received Webmention failures
Map known verification failures to human-readable explanations and show
suggested next steps only for receiver-controlled problems while
retaining raw reasons.
Return a specific validation error when targets are outside
`ALLOWED_TARGET_HOSTNAMES` and reuse the guidance for status history.
Diffstat (limited to 'tests/forms/test_validators.py')
| -rw-r--r-- | tests/forms/test_validators.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/forms/test_validators.py b/tests/forms/test_validators.py index 4234552..8822310 100644 --- a/tests/forms/test_validators.py +++ b/tests/forms/test_validators.py @@ -28,7 +28,9 @@ def test_allowed_hostname_accepts_configured_hostname(app: Flask) -> None: def test_allowed_hostname_rejects_unconfigured_hostname(app: Flask) -> None: app.config["ALLOWED_TARGET_HOSTNAMES"] = ["dennisfink.me"] form = URLForm(MultiDict({"url": "https://example.com/post"})) - with app.app_context(), pytest.raises(ValidationError, match="Invalid input"): + with app.app_context(), pytest.raises( + ValidationError, match="Target hostname is not in ALLOWED_TARGET_HOSTNAMES" + ): AllowedTargetHostname()(form, form.url) |
