From c44e0da26b490be87c9c4d16cdbf3da709bdf066 Mon Sep 17 00:00:00 2001 From: Dale Date: Wed, 19 Mar 2025 20:40:47 +1000 Subject: [PATCH] Updated tests to pass tests on scripts/test-cov-html.sh --- tests/test_tutorial/test_security/test_tutorial009.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_tutorial/test_security/test_tutorial009.py b/tests/test_tutorial/test_security/test_tutorial009.py index 09cc8e972..a2c11c82b 100644 --- a/tests/test_tutorial/test_security/test_tutorial009.py +++ b/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"}