-from dirty_equals import IsDict
+from dirty_equals import IsDict, IsOneOf
from fastapi.testclient import TestClient
from docs_src.custom_request_and_route.tutorial002 import app
"input": {"numbers": [1, 2, 3]},
}
],
- "body": '{"numbers": [1, 2, 3]}',
+ # httpx 0.28.0 switches to compact JSON https://github.com/encode/httpx/issues/3363
+ "body": IsOneOf('{"numbers": [1, 2, 3]}', '{"numbers":[1,2,3]}'),
}
}
) | IsDict(
# TODO: remove when deprecating Pydantic v1
{
"detail": {
- "body": '{"numbers": [1, 2, 3]}',
+ # httpx 0.28.0 switches to compact JSON https://github.com/encode/httpx/issues/3363
+ "body": IsOneOf('{"numbers": [1, 2, 3]}', '{"numbers":[1,2,3]}'),
"errors": [
{
"loc": ["body"],