Merge branch '1.0.x'

This commit is contained in:
David Lord 2019-05-17 11:13:08 -07:00
commit 05a4e15ee4
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
7 changed files with 105 additions and 49 deletions

View file

@ -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"