Merge remote-tracking branch 'origin/0.10-maintenance'

refactor make_test_environ_builder
This commit is contained in:
David Lord 2017-05-28 07:25:15 -07:00
commit a37f675ccb
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
3 changed files with 70 additions and 11 deletions

View file

@ -2017,10 +2017,19 @@ class Flask(_PackageBoundObject):
def test_request_context(self, *args, **kwargs):
"""Creates a WSGI environment from the given values (see
:class:`werkzeug.test.EnvironBuilder` for more information, this
function accepts the same arguments).
function accepts the same arguments plus two additional).
Additional arguments (only if ``base_url`` is not specified):
:param subdomain: subdomain to use for route matching
:param url_scheme: scheme for the request, default
``PREFERRED_URL_SCHEME`` or ``http``.
"""
from flask.testing import make_test_environ_builder
builder = make_test_environ_builder(self, *args, **kwargs)
try:
return self.request_context(builder.get_environ())
finally: