Home / Function/ test_post_body_json() — fastapi Function Reference

test_post_body_json() — fastapi Function Reference

Architecture documentation for the test_post_body_json() function in test_tutorial001.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  ae0b2b7f_c51a_35d8_d4d5_562219fa8274["test_post_body_json()"]
  f315bde3_0464_f9b6_cb1f_30e31d3c2c05["test_tutorial001.py"]
  ae0b2b7f_c51a_35d8_d4d5_562219fa8274 -->|defined in| f315bde3_0464_f9b6_cb1f_30e31d3c2c05
  style ae0b2b7f_c51a_35d8_d4d5_562219fa8274 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_request_files/test_tutorial001.py lines 37–49

def test_post_body_json(client: TestClient):
    response = client.post("/files/", json={"file": "Foo"})
    assert response.status_code == 422, response.text
    assert response.json() == {
        "detail": [
            {
                "type": "missing",
                "loc": ["body", "file"],
                "msg": "Field required",
                "input": None,
            }
        ]
    }

Domain

Subdomains

Frequently Asked Questions

What does test_post_body_json() do?
test_post_body_json() is a function in the fastapi codebase, defined in tests/test_tutorial/test_request_files/test_tutorial001.py.
Where is test_post_body_json() defined?
test_post_body_json() is defined in tests/test_tutorial/test_request_files/test_tutorial001.py at line 37.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free