Browse Source

Updated tests to pass tests on scripts/test-cov-html.sh

pull/13434/head
Dale 3 weeks ago
parent
commit
c44e0da26b
  1. 4
      tests/test_tutorial/test_security/test_tutorial009.py

4
tests/test_tutorial/test_security/test_tutorial009.py

@ -40,12 +40,14 @@ def test_openapi_schema():
def test_security_api_key():
response = client.get("/users/me", cookies={"key": "secret"})
client.cookies={"key": "secret"}
response = client.get("/users/me") #, cookies={"key": "secret"})
assert response.status_code == 200, response.text
assert response.json() == {"username": "secret"}
def test_security_api_key_no_key():
client.cookies=None
response = client.get("/users/me")
assert response.status_code == 403, response.text
assert response.json() == {"detail": "Not authenticated"}

Loading…
Cancel
Save