From 0af183f7bca7c1c37eb8ef8e81e31fb5ba6a477a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregor=20D=C3=BCster?= Date: Thu, 16 May 2024 11:11:01 +0200 Subject: [PATCH] Accept url as forbidden if HTTP method not supported --- tests/frontend/assertions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/frontend/assertions.py b/tests/frontend/assertions.py index b197fe500..62876ba72 100644 --- a/tests/frontend/assertions.py +++ b/tests/frontend/assertions.py @@ -90,7 +90,7 @@ def assert_url_forbidden(self, url: str, method: str = "HEAD", **kw) -> Response resp = self.open(url, method=method, **kw) status = resp.status_code assert ( - status == 403 + status == 403 or status == 405 ), f"Access to {url} expected to be forbidden, got status {status}" return resp