app.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:annotated-py-flask 作者: hhstore 项目源码 文件源码
def test_client(self):
        """Creates a test client for this application.  For information
        about unit testing head over to :ref:`testing`.

        The test client can be used in a `with` block to defer the closing down
        of the context until the end of the `with` block.  This is useful if
        you want to access the context locals for testing::

            with app.test_client() as c:
                rv = c.get('/?vodka=42')
                assert request.args['vodka'] == '42'

        .. versionchanged:: 0.4
           added support for `with` block usage for the client.
        """
        from flask.testing import FlaskClient
        return FlaskClient(self, self.response_class, use_cookies=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号