forked from orbit-oss/flask
Merge branch '1.0.x'
This commit is contained in:
commit
05a4e15ee4
7 changed files with 105 additions and 49 deletions
|
|
@ -71,12 +71,10 @@ def make_test_environ_builder(
|
|||
sep = b"?" if isinstance(url.query, bytes) else "?"
|
||||
path += sep + url.query
|
||||
|
||||
# TODO use EnvironBuilder.json_dumps once we require Werkzeug 0.15
|
||||
if "json" in kwargs:
|
||||
assert "data" not in kwargs, "Client cannot provide both 'json' and 'data'."
|
||||
|
||||
# push a context so flask.json can use app's json attributes
|
||||
with app.app_context():
|
||||
kwargs["data"] = json_dumps(kwargs.pop("json"))
|
||||
kwargs["data"] = json_dumps(kwargs.pop("json"), app=app)
|
||||
|
||||
if "content_type" not in kwargs:
|
||||
kwargs["content_type"] = "application/json"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue