|
@ -23,13 +23,13 @@ def test_security_http_bearer(): |
|
|
|
|
|
|
|
|
def test_security_http_bearer_no_credentials(): |
|
|
def test_security_http_bearer_no_credentials(): |
|
|
response = client.get("/users/me") |
|
|
response = client.get("/users/me") |
|
|
assert response.status_code == 403, response.text |
|
|
assert response.status_code == 401, response.text |
|
|
assert response.json() == {"detail": "Not authenticated"} |
|
|
assert response.json() == {"detail": "Not authenticated"} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_security_http_bearer_incorrect_scheme_credentials(): |
|
|
def test_security_http_bearer_incorrect_scheme_credentials(): |
|
|
response = client.get("/users/me", headers={"Authorization": "Basic notreally"}) |
|
|
response = client.get("/users/me", headers={"Authorization": "Basic notreally"}) |
|
|
assert response.status_code == 403, response.text |
|
|
assert response.status_code == 401, response.text |
|
|
assert response.json() == {"detail": "Invalid authentication credentials"} |
|
|
assert response.json() == {"detail": "Invalid authentication credentials"} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|