Skip to content
Myr

Add test for jsonify padded=False, #495.

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

authored by Ron DuPlain · committed by Ron DuPlain · parent 2ae2338 · Browse files · 1 file+5 added−2 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+5 added−2 removed

  • other:+5 added−2 removed

1 file+5 added−2 removed

modified:flask/testsuite/helpers.py+5 added-2 removed
71 unmodified lines
72 return flask.jsonify(**d)73 @app.route('/dict')74 def return_dict():75 return flask.jsonify(d)76 @app.route("/unpadded")77 def return_padded_false():78 return flask.jsonify(d, padded=False)79 @app.route("/padded")77 def return_padded_json():80 def return_padded_true():81 return flask.jsonify(d, padded=True)82 @app.route("/padded_custom")83 def return_padded_json_custom_callback():84 return flask.jsonify(d, padded='my_func_name')85 c = app.test_client()83 for url in '/kw', '/dict':86 for url in '/kw', '/dict', '/unpadded':87 rv = c.get(url)88 self.assert_equal(rv.mimetype, 'application/json')89 self.assert_equal(flask.json.loads(rv.data), d)90 for get_arg in 'callback=funcName', 'jsonp=funcName':
325 unmodified lines