From 89b7dc804e5f30238475aa341cd3d61db44a1e3f Mon Sep 17 00:00:00 2001 From: usrme Date: Wed, 23 Feb 2022 22:18:20 +0200 Subject: [PATCH 1/4] update reference to 'query_string' parameter --- docs/testing.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/testing.rst b/docs/testing.rst index d68cb533..74f722a0 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -92,7 +92,7 @@ The ``client`` has methods that match the common HTTP request methods, such as ``client.get()`` and ``client.post()``. They take many arguments for building the request; you can find the full documentation in :class:`~werkzeug.test.EnvironBuilder`. Typically you'll use ``path``, -``query``, ``headers``, and ``data`` or ``json``. +``query_string``, ``headers``, and ``data`` or ``json``. To make a request, call the method the request should use with the path to the route to test. A :class:`~werkzeug.test.TestResponse` is returned @@ -108,9 +108,11 @@ provides ``response.text``, or use ``response.get_data(as_text=True)``. assert b"

Hello, World!

" in response.data -Pass a dict ``query={"key": "value", ...}`` to set arguments in the -query string (after the ``?`` in the URL). Pass a dict ``headers={}`` -to set request headers. +Pass a dict ``query_string={"key": "value", ...}`` to set arguments in +the query string (after the ``?`` in the URL). You can also pass a +string if you want to set a specific value directly. + +Pass a dict to ``headers={}`` to set request headers. To send a request body in a POST or PUT request, pass a value to ``data``. If raw bytes are passed, that exact body is used. Usually, From 21ee19c1b71127f8bbe6627321514389029f85d5 Mon Sep 17 00:00:00 2001 From: Abdur-Rahmaan Janhangeer Date: Sat, 26 Feb 2022 11:26:09 +0400 Subject: [PATCH 2/4] fix dict syntax in testing doc --- docs/testing.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/testing.rst b/docs/testing.rst index 74f722a0..5e9cc1a1 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -144,9 +144,9 @@ use ``pathlib.Path`` to get files relative to the current test file. def test_edit_user(client): response = client.post("/user/2/edit", data={ - name="Flask", - theme="dark", - picture=(resources / "picture.png").open("rb"), + "name":"Flask", + "theme":"dark", + "picture":(resources / "picture.png").open("rb"), }) assert response.status_code == 200 From 5be744ed5538973102d2bf4923e0223c7f31b7f9 Mon Sep 17 00:00:00 2001 From: Grey Li Date: Sun, 27 Feb 2022 21:19:14 +0800 Subject: [PATCH 3/4] Format code snippet in testing docs properly --- docs/testing.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/testing.rst b/docs/testing.rst index 5e9cc1a1..eaf0d920 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -144,9 +144,9 @@ use ``pathlib.Path`` to get files relative to the current test file. def test_edit_user(client): response = client.post("/user/2/edit", data={ - "name":"Flask", - "theme":"dark", - "picture":(resources / "picture.png").open("rb"), + "name": "Flask", + "theme": "dark", + "picture": (resources / "picture.png").open("rb"), }) assert response.status_code == 200 From 4685c251c64da45f7c134a16ae92698db6b43d63 Mon Sep 17 00:00:00 2001 From: Grey Li Date: Sat, 26 Mar 2022 09:24:50 +0800 Subject: [PATCH 4/4] Add missing docstring for Blueprint cli_group --- src/flask/blueprints.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/flask/blueprints.py b/src/flask/blueprints.py index 5c23a735..2aa8b4dd 100644 --- a/src/flask/blueprints.py +++ b/src/flask/blueprints.py @@ -153,6 +153,8 @@ class Blueprint(Scaffold): this based on ``import_name``. In certain situations this automatic detection can fail, so the path can be specified manually instead. + :param cli_group: The name of the blueprint's CLI group. If not set, + the blueprint name will be used. .. versionchanged:: 1.1.0 Blueprints have a ``cli`` group to register nested CLI commands.