Skip to content
Myr

Fix failing test: "AssertionError: 'application/javascript' != 'application/json'" in flask/testsuite/helpers.py", line 88

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

authored by Marc Abramowitz · committed by Marc Abramowitz · parent 086348e · Browse files · 1 file+7 added−3 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+7 added−3 removed

  • other:+7 added−3 removed

1 file+7 added−3 removed

modified:flask/helpers.py+7 added-3 removed
131 unmodified lines
132 callback-function name.133 """134 if __debug__:135 _assert_have_json()136137 padded = kwargs.get('padded', False)138 if 'padded' in kwargs:139 del kwargs['padded']140141 if padded:137 if isinstance(kwargs['padded'], str):138 callback = request.args.get(kwargs['padded']) or 'jsonp'142 if isinstance(padded, str):143 callback = request.args.get(padded) or 'jsonp'144 else:145 callback = request.args.get('callback') or \146 request.args.get('jsonp') or 'jsonp'142 del kwargs['padded']147 json_str = json.dumps(dict(*args, **kwargs), indent=None)148 content = str(callback) + "(" + json_str + ")"149 return current_app.response_class(content, mimetype='application/javascript')150 return current_app.response_class(json.dumps(dict(*args, **kwargs),
684 unmodified lines