Browse Source

🎨 [pre-commit.ci] Auto format from pre-commit.com hooks

pull/13434/head
pre-commit-ci[bot] 2 weeks ago
parent
commit
31556a1b85
  1. 6
      tests/test_tutorial/test_security/test_tutorial009.py

6
tests/test_tutorial/test_security/test_tutorial009.py

@ -40,14 +40,14 @@ def test_openapi_schema():
def test_security_api_key():
client.cookies={"key": "secret"}
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
client.cookies = None
response = client.get("/users/me")
assert response.status_code == 403, response.text
assert response.json() == {"detail": "Not authenticated"}

Loading…
Cancel
Save