tests/test_tutorial/test_custom_response/test_tutorial009c.py
raw| 1 | import pytest |
| 2 | from fastapi.testclient import TestClient |
| 3 | |
| 4 | pytest.importorskip("orjson") |
| 5 | |
| 6 | from docs_src.custom_response.tutorial009c_py310 import app |
| 7 | |
| 8 | client = TestClient(app) |
| 9 | |
| 10 | |
| 11 | def test_get(): |
| 12 | response = client.get("/") |
| 13 | assert response.content == b'{\n "message": "Hello World"\n}' |