test_put_invalid_data() — fastapi Function Reference
Architecture documentation for the test_put_invalid_data() function in test_tutorial001.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD 27de0f95_bf9a_343e_fc1c_1c1b939596b6["test_put_invalid_data()"] 9ee9373a_b923_622d_7596_fd0836d411d9["test_tutorial001.py"] 27de0f95_bf9a_343e_fc1c_1c1b939596b6 -->|defined in| 9ee9373a_b923_622d_7596_fd0836d411d9 style 27de0f95_bf9a_343e_fc1c_1c1b939596b6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_tutorial/test_encoder/test_tutorial001.py lines 49–71
def test_put_invalid_data(client: TestClient, mod: ModuleType):
fake_db = mod.fake_db
response = client.put(
"/items/345",
json={
"title": "Foo",
"timestamp": "not a date",
},
)
assert response.status_code == 422
assert response.json() == {
"detail": [
{
"loc": ["body", "timestamp"],
"msg": "Input should be a valid datetime or date, invalid character in year",
"type": "datetime_from_date_parsing",
"input": "not a date",
"ctx": {"error": "invalid character in year"},
}
]
}
assert "345" not in fake_db
Domain
Subdomains
Source
Frequently Asked Questions
What does test_put_invalid_data() do?
test_put_invalid_data() is a function in the fastapi codebase, defined in tests/test_tutorial/test_encoder/test_tutorial001.py.
Where is test_put_invalid_data() defined?
test_put_invalid_data() is defined in tests/test_tutorial/test_encoder/test_tutorial001.py at line 49.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free