forked from orbit-oss/flask
Add JSONIFY_MIMETYPE configuration variable (#1728)
Allow jsonify responses' mimetype to be configured
This commit is contained in:
parent
0690ce18c2
commit
2bf477cfea
5 changed files with 16 additions and 1 deletions
|
|
@ -1019,6 +1019,18 @@ def test_jsonify_prettyprint():
|
|||
assert rv.data == pretty_response
|
||||
|
||||
|
||||
def test_jsonify_mimetype():
|
||||
app = flask.Flask(__name__)
|
||||
app.config.update({"JSONIFY_MIMETYPE": 'application/vnd.api+json'})
|
||||
with app.test_request_context():
|
||||
msg = {
|
||||
"msg": {"submsg": "W00t"},
|
||||
}
|
||||
rv = flask.make_response(
|
||||
flask.jsonify(msg), 200)
|
||||
assert rv.mimetype == 'application/vnd.api+json'
|
||||
|
||||
|
||||
def test_url_generation():
|
||||
app = flask.Flask(__name__)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue