diff --git a/flask/json/__init__.py b/flask/json/__init__.py index 30e54525..3ecdd575 100644 --- a/flask/json/__init__.py +++ b/flask/json/__init__.py @@ -292,7 +292,7 @@ def jsonify(*args, **kwargs): } - .. versionchanged:: 0.11 + .. versionchanged:: 1.1 Added support for status parameter This function's response will be pretty printed if the diff --git a/tests/test_helpers.py b/tests/test_helpers.py index a0e9ab33..240eeba7 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -244,7 +244,17 @@ class TestJSON(object): assert rv_uuid == test_uuid def test_jsonify_status(self, app, client): - flask.jsonify({'code': 400}, status=400) + @app.route('/statusarg') + def return_arg_status(): + return flask.jsonify({'code': 400}, status=400) + + @app.route('/statuskwarg') + def return_kwarg_status(): + return flask.jsonify(code=400, status=400) + + for url in '/statuskwarg', '/statusarg': + rv = client.get(url) + assert rv.status_code == 400 def test_json_attr(self, app, client):