diff options
| author | Dennis Fink | 2026-11-13 21:27:28 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-13 21:27:28 +0100 |
| commit | b0f3eeb78bcf601982d04f3aa595ab8942de417f (patch) | |
| tree | 95f9fdd8eb4989b7b026a618ecbb952820584d13 /tests/views/test_admin.py | |
| parent | a285fdf29e59c3b957247ea9241943c7202e9a28 (diff) | |
| download | webmentions-ssg-b0f3eeb78bcf601982d04f3aa595ab8942de417f.tar.gz webmentions-ssg-b0f3eeb78bcf601982d04f3aa595ab8942de417f.zip | |
fix(core): reject invalid admin action forms
Centralize administrative form validation so all protected actions
return HTTP 400 on invalid submissions instead of allowing the rescan
action to fail silently.
Diffstat (limited to 'tests/views/test_admin.py')
| -rw-r--r-- | tests/views/test_admin.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/views/test_admin.py b/tests/views/test_admin.py index 1499f64..f166318 100644 --- a/tests/views/test_admin.py +++ b/tests/views/test_admin.py @@ -225,11 +225,11 @@ def test_rescan_sent_sources( response = client.post("/sent/rescan") - assert response.status_code == 302 - assert response.headers["Location"].endswith("/sent") + assert response.status_code == (302 if valid else 400) form.validate_on_submit.assert_called_once_with() if valid: + assert response.headers["Location"].endswith("/sent") manual_scan_sources.assert_called_once_with() else: manual_scan_sources.assert_not_called() |
