Browse Source

Add assertion on www-authenticate header.

pull/5332/head
Pieter Ennes 1 year ago
parent
commit
586938e13c
  1. 1
      tests/test_security_openid_connect.py
  2. 1
      tests/test_security_openid_connect_description.py

1
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"}

1
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"}

Loading…
Cancel
Save