From eb11fb64e9cad6fbda2065362189653416d98577 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Thu, 19 Nov 2026 21:18:37 +0100 Subject: test: expand failure and migration coverage Add regression coverage for malformed input, lost task claims, moderation races, network failures, serializer validation, and production configuration guards. Exercise migration downgrade, backfill, and autogeneration paths plus additional receiver and sender edge cases. --- tests/test_auth.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/test_auth.py') diff --git a/tests/test_auth.py b/tests/test_auth.py index 27e8fb0..2a3d517 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -161,3 +161,13 @@ def test_password_change_invalidates_existing_session(app: Flask) -> None: ) def test_is_safe_next_url(next_url: str, expected: bool) -> None: assert is_safe_next_url(next_url) is expected + + +def test_safe_next_url_fails_closed_when_url_parser_rejects_path( + monkeypatch: pytest.MonkeyPatch, +) -> None: + def invalid_url(_: str) -> object: + raise ValueError("Malformed URL") + + monkeypatch.setattr(auth, "urlsplit", invalid_url) + assert is_safe_next_url("/local/path") is False -- cgit v1.3.1