Add negative test for json.jsonify (#1876)

Test if jsonify function raises TypeError when both args and kwargs are
passed in.
Check the TypeError's message
This commit is contained in:
dawran6 2016-06-03 10:58:39 -07:00 committed by David Lord
parent 225c311f1b
commit e048aa4e19

View file

@ -1031,6 +1031,14 @@ def test_jsonify_mimetype():
assert rv.mimetype == 'application/vnd.api+json'
def test_jsonify_args_and_kwargs_check():
app = flask.Flask(__name__)
with app.test_request_context():
with pytest.raises(TypeError) as e:
flask.jsonify('fake args', kwargs='fake')
assert 'behavior undefined' in str(e.value)
def test_url_generation():
app = flask.Flask(__name__)