diff --git a/tests/test_security_openid_connect.py b/tests/test_security_openid_connect.py index 8a548e5c7..5d5d34a67 100644 --- a/tests/test_security_openid_connect.py +++ b/tests/test_security_openid_connect.py @@ -40,6 +40,7 @@ def test_security_oauth2_password_other_header(): def test_security_oauth2_password_bearer_no_header(): response = client.get("/users/me") assert response.status_code == 401, response.text + assert response.headers["WWW-Authenticate"] == "Bearer" assert response.json() == {"detail": "Not authenticated"} diff --git a/tests/test_security_openid_connect_description.py b/tests/test_security_openid_connect_description.py index dc4bc649a..24f10801f 100644 --- a/tests/test_security_openid_connect_description.py +++ b/tests/test_security_openid_connect_description.py @@ -42,6 +42,7 @@ def test_security_oauth2_password_other_header(): def test_security_oauth2_password_bearer_no_header(): response = client.get("/users/me") assert response.status_code == 401, response.text + assert response.headers["WWW-Authenticate"] == "Bearer" assert response.json() == {"detail": "Not authenticated"}