Coverage for tests / test_tutorial / test_response_cookies / test_tutorial002.py: 100%
8 statements
« prev ^ index » next coverage.py v7.13.3, created at 2026-04-06 01:24 +0000
« prev ^ index » next coverage.py v7.13.3, created at 2026-04-06 01:24 +0000
1from fastapi.testclient import TestClient 1abcd
3from docs_src.response_cookies.tutorial002_py310 import app 1abcd
5client = TestClient(app) 1abcd
8def test_path_operation(): 1abcd
9 response = client.post("/cookie-and-object/") 1efgh
10 assert response.status_code == 200, response.text 1efgh
11 assert response.json() == {"message": "Come to the dark side, we have cookies"} 1efgh
12 assert response.cookies["fakesession"] == "fake-cookie-session-value" 1efgh