mirror of https://github.com/pallets/flask.git
Pass keyword args from `test_client` method to client class constructor
This commit is contained in:
parent
6b3fbb323a
commit
fed6fd32d8
|
|
@ -821,7 +821,7 @@ class Flask(_PackageBoundObject):
|
||||||
# without reloader and that stuff from an interactive shell.
|
# without reloader and that stuff from an interactive shell.
|
||||||
self._got_first_request = False
|
self._got_first_request = False
|
||||||
|
|
||||||
def test_client(self, use_cookies=True):
|
def test_client(self, use_cookies=True, **kwargs):
|
||||||
"""Creates a test client for this application. For information
|
"""Creates a test client for this application. For information
|
||||||
about unit testing head over to :ref:`testing`.
|
about unit testing head over to :ref:`testing`.
|
||||||
|
|
||||||
|
|
@ -857,7 +857,7 @@ class Flask(_PackageBoundObject):
|
||||||
cls = self.test_client_class
|
cls = self.test_client_class
|
||||||
if cls is None:
|
if cls is None:
|
||||||
from flask.testing import FlaskClient as cls
|
from flask.testing import FlaskClient as cls
|
||||||
return cls(self, self.response_class, use_cookies=use_cookies)
|
return cls(self, self.response_class, use_cookies=use_cookies, **kwargs)
|
||||||
|
|
||||||
def open_session(self, request):
|
def open_session(self, request):
|
||||||
"""Creates or opens a new session. Default implementation stores all
|
"""Creates or opens a new session. Default implementation stores all
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue