MCPcopy
hub / github.com/pallets/flask / test_json_bad_requests

Function test_json_bad_requests

tests/test_json.py:30–36  ·  view source on GitHub ↗
(app, client)

Source from the content-addressed store, hash-verified

28
29
30def test_json_bad_requests(app, client):
31 @app.route("/json", methods=["POST"])
32 def return_json():
33 return flask.jsonify(foo=str(flask.request.get_json()))
34
35 rv = client.post("/json", data="malformed", content_type="application/json")
36 assert rv.status_code == 400
37
38
39def test_json_custom_mimetypes(app, client):

Callers

nothing calls this directly

Calls 1

postMethod · 0.45

Tested by

no test coverage detected