test_post_form_for_json() — fastapi Function Reference
Architecture documentation for the test_post_form_for_json() function in test_tutorial001.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD d0a9e8d9_ff40_8ca9_93a8_41054a17aced["test_post_form_for_json()"] 384ebf37_bf33_dd11_7410_101f39082f41["test_tutorial001.py"] d0a9e8d9_ff40_8ca9_93a8_41054a17aced -->|defined in| 384ebf37_bf33_dd11_7410_101f39082f41 style d0a9e8d9_ff40_8ca9_93a8_41054a17aced fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_tutorial/test_body/test_tutorial001.py lines 160–172
def test_post_form_for_json(client: TestClient):
response = client.post("/items/", data={"name": "Foo", "price": 50.5})
assert response.status_code == 422, response.text
assert response.json() == {
"detail": [
{
"type": "model_attributes_type",
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": "name=Foo&price=50.5",
}
]
}
Domain
Subdomains
Source
Frequently Asked Questions
What does test_post_form_for_json() do?
test_post_form_for_json() is a function in the fastapi codebase, defined in tests/test_tutorial/test_body/test_tutorial001.py.
Where is test_post_form_for_json() defined?
test_post_form_for_json() is defined in tests/test_tutorial/test_body/test_tutorial001.py at line 160.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free