Skip to content

Commit 6ca9fb1

Browse files
committed
fix: failing test
1 parent 4190dd1 commit 6ca9fb1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/functional/event_handler/test_openapi_validation_middleware.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ class Model(BaseModel):
343343
# WHEN a handler is defined with a body parameter
344344
@app.post("/")
345345
def handler(user: Model) -> Response[Model]:
346-
return Response(body=user, status_code=200)
346+
return Response(body=user, status_code=200, content_type="application/json")
347347

348348
LOAD_GW_EVENT["httpMethod"] = "POST"
349349
LOAD_GW_EVENT["path"] = "/"
@@ -353,7 +353,7 @@ def handler(user: Model) -> Response[Model]:
353353
# THEN the body must be a dict
354354
result = app(LOAD_GW_EVENT, {})
355355
assert result["statusCode"] == 200
356-
assert result["body"] == {"name": "John", "age": 30}
356+
assert json.loads(result["body"]) == {"name": "John", "age": 30}
357357

358358

359359
def test_validate_response_invalid_return():

0 commit comments

Comments
 (0)