Debian Codegraph @

tests/test_tutorial/test_response_cookies/test_tutorial002.py

raw
1 from fastapi.testclient import TestClient
2
3 from docs_src.response_cookies.tutorial002_py310 import app
4
5 client = TestClient(app)
6
7
8 def test_path_operation():
9 response = client.post("/cookie-and-object/")
10 assert response.status_code == 200, response.text
11 assert response.json() == {"message": "Come to the dark side, we have cookies"}
12 assert response.cookies["fakesession"] == "fake-cookie-session-value"