diff --git a/tests/test_response.py b/tests/test_response.py index db3036ea..6c937fcb 100644 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -178,6 +178,10 @@ def json_app(app): async def unmodified_handler(request: Request): return json(JSON_DATA, status=304) + @app.get("/precondition") + async def precondition_handler(request: Request): + return json(JSON_DATA, status=412) + @app.delete("/") async def delete_handler(request: Request): return json(None, status=204) @@ -193,6 +197,10 @@ def test_json_response(json_app): assert response.text == json_dumps(JSON_DATA) assert response.json == JSON_DATA + request, response = json_app.test_client.get("/precondition") + assert response.status == 412 + assert response.json == JSON_DATA + def test_no_content(json_app): request, response = json_app.test_client.get("/no-content")