diff --git a/tests/test_response.py b/tests/test_response.py index 475da8b6..e7690c11 100644 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -63,8 +63,12 @@ def json_app(): async def test(request): return json(JSON_DATA) + @app.get("/no-content") + async def no_content_handler(request): + return json(JSON_DATA, status=204) + @app.delete("/") - async def test_delete(request): + async def delete_handler(request): return json(None, status=204) return app @@ -79,6 +83,11 @@ def test_json_response(json_app): def test_no_content(json_app): + request, response = json_app.test_client.get('/no-content') + assert response.status == 204 + assert response.text == '' + assert response.headers['Content-Length'] == '0' + request, response = json_app.test_client.delete('/') assert response.status == 204 assert response.text == ''