ycdemo / fastapi / tests/ test_tutorial/ test_custom_response/ test_tutorial009c.py

import pytest
from fastapi.testclient import TestClient

pytest.importorskip("orjson")

from docs_src.custom_response.tutorial009c_py310 import app

client = TestClient(app)


def test_get():
    response = client.get("/")
    assert response.content == b'{\n  "message": "Hello World"\n}'