aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTomasz Kramkowski <tomasz@kramkow.ski>2023-03-27 18:46:16 +0100
committerTomasz Kramkowski <tomasz@kramkow.ski>2023-03-27 19:01:15 +0100
commit35534d46bef472b1d1cb19ee4c5949823053da2a (patch)
tree2c1fe22593f7a5535ef4177663b9c48f092f70c7 /tests
parent4a0a47ce23080142b12832b44e6cd56072c50df2 (diff)
downloadpaste-35534d46bef472b1d1cb19ee4c5949823053da2a.tar.gz
paste-35534d46bef472b1d1cb19ee4c5949823053da2a.tar.xz
paste-35534d46bef472b1d1cb19ee4c5949823053da2a.zip
Respond to auth failures with WWW-Authenticate
Diffstat (limited to 'tests')
-rw-r--r--tests/middleware/test_authenticate.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/middleware/test_authenticate.py b/tests/middleware/test_authenticate.py
index 28ccef2..2395316 100644
--- a/tests/middleware/test_authenticate.py
+++ b/tests/middleware/test_authenticate.py
@@ -53,6 +53,7 @@ def test_authenticate_no_header(app, method, monkeypatch):
assert response.data == b"401 Unauthorized\n"
assert response.status == "401 Unauthorized"
assert ("Content-Type", "text/plain") in response.headers
+ assert ("WWW-Authenticate", "APIKey") in response.headers
@pytest.mark.parametrize("method", ["POST", "PUT", "DELETE"])
@@ -64,6 +65,7 @@ def test_authenticate_malformed_key(app, method, key, monkeypatch):
assert response.data == b"401 Unauthorized\n"
assert response.status == "401 Unauthorized"
assert ("Content-Type", "text/plain") in response.headers
+ assert ("WWW-Authenticate", "APIKey") in response.headers
@pytest.mark.parametrize("method", ["POST", "PUT", "DELETE"])
@@ -89,6 +91,7 @@ def test_authenticate_check_token_fail(app, method, monkeypatch):
assert response.data == b"401 Unauthorized\n"
assert response.status == "401 Unauthorized"
assert ("Content-Type", "text/plain") in response.headers
+ assert ("WWW-Authenticate", "APIKey") in response.headers
@pytest.mark.parametrize("method", ["POST", "PUT", "DELETE"])