We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da33350 commit 7075126Copy full SHA for 7075126
tests/test_api.py
@@ -68,17 +68,11 @@ def test_post_file_route() -> None:
68
def test_post_file_route_failure() -> None:
69
response = client.post("/file")
70
assert response.status_code == 422 # Unprocessable Entity
71
- assert response.json() == {
72
- "detail": [
73
- {
74
- "type": "missing",
75
- "loc": ["body", "file"],
76
- "msg": "Field required",
77
- "input": None,
78
- "url": "https://errors.pydantic.dev/2.5/v/missing",
79
- }
80
- ]
81
+ error_detail = response.json().get("detail", [])
+ assert error_detail
+ assert error_detail[0]["loc"] == ["body", "file"]
+ assert "Field required" in error_detail[0]["msg"]
+
82
83
84
def test_post_file_route_size_limit() -> None:
0 commit comments