Browse Source

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
pull/1882/head
dawran6 9 years ago committed by David Lord
parent
commit
e048aa4e19
  1. 8
      tests/test_basic.py

8
tests/test_basic.py

@ -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__)

Loading…
Cancel
Save