Skip to content
Myr

Add negative test for json.jsonify (#1876)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Test if jsonify function raises TypeError when both args and kwargs are passed in. Check the TypeError's message

authored by dawran6 · committed by David Lord · parent 225c311 · Browse files · 1 file+8 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−0 removed

  • tests:+8 added−0 removed

1 file+8 added−0 removed

modified:tests/test_basic.py+8 added
1029 unmodified lines
1030 flask.jsonify(msg), 200)1031 assert rv.mimetype == 'application/vnd.api+json'103210331034def test_jsonify_args_and_kwargs_check():1035 app = flask.Flask(__name__)1036 with app.test_request_context():1037 with pytest.raises(TypeError) as e:1038 flask.jsonify('fake args', kwargs='fake')1039 assert 'behavior undefined' in str(e.value)104010411042def test_url_generation():1043 app = flask.Flask(__name__)10441045 @app.route('/hello/<name>', methods=['POST'])
617 unmodified lines