From 7751b25d53791bd3653c62ab089e970c938ff695 Mon Sep 17 00:00:00 2001 From: fourjr <28086837+fourjr@users.noreply.github.com> Date: Thu, 28 Jun 2018 19:12:58 +0800 Subject: [PATCH] Fix for testing --- flask/json/__init__.py | 2 +- tests/test_helpers.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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):