!37 Fix incorrect references to query in testing doc
From: @zhang-liang-pengkun Reviewed-by: @Charlie_li Signed-off-by: @Charlie_li
This commit is contained in:
commit
954f1b0377
41
Fix-incorrect-references-to-query-in-testing-doc.patch
Normal file
41
Fix-incorrect-references-to-query-in-testing-doc.patch
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
From 5d31ce1031e8ca24dc908c319567a76110edd87e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Nick Kocharhook <nick@kocharhook.com>
|
||||||
|
Date: Wed, 1 Jun 2022 12:16:21 -0700
|
||||||
|
Subject: [PATCH] Fix incorrect references to query in testing doc
|
||||||
|
|
||||||
|
The [EnvironBuilder doc](https://werkzeug.palletsprojects.com/en/2.1.x/test/#werkzeug.test.EnvironBuilder) shows that the correct name for the keyword argument is `query_string`, not `query`. Using `query` results in an error.
|
||||||
|
|
||||||
|
I've fixed the two places this appears in the testing doc.
|
||||||
|
---
|
||||||
|
docs/testing.rst | 8 ++++----
|
||||||
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/docs/testing.rst b/docs/testing.rst
|
||||||
|
index 6f9d6ee1..8545bd39 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,9 @@ provides ``response.text``, or use ``response.get_data(as_text=True)``.
|
||||||
|
assert b"<h2>Hello, World!</h2>" 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). Pass a dict
|
||||||
|
+``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,
|
||||||
|
--
|
||||||
|
2.39.0.windows.2
|
||||||
|
|
||||||
@ -1,12 +1,13 @@
|
|||||||
Name: python-flask
|
Name: python-flask
|
||||||
Version: 2.1.2
|
Version: 2.1.2
|
||||||
Release: 2
|
Release: 3
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
Summary: A lightweight WSGI web application framework
|
Summary: A lightweight WSGI web application framework
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
URL: https://palletsprojects.com/p/flask/
|
URL: https://palletsprojects.com/p/flask/
|
||||||
Source0: https://files.pythonhosted.org/packages/source/F/Flask/Flask-%{version}.tar.gz
|
Source0: https://files.pythonhosted.org/packages/source/F/Flask/Flask-%{version}.tar.gz
|
||||||
Patch0: Fix-linting-error.patch
|
Patch0: Fix-linting-error.patch
|
||||||
|
Patch1: Fix-incorrect-references-to-query-in-testing-doc.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
@ -53,8 +54,11 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} -v || :
|
|||||||
%{python3_sitelib}/*
|
%{python3_sitelib}/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Jan 13 2023 zhangliangpengkun<zhangliangpengkun@xfusion.com> - 1:2.1.2-3
|
||||||
|
- Fix incorrect references to query in testing doc
|
||||||
|
|
||||||
* Mon Jan 9 2023 zhangliangpengkun<zhangliangpengkun@xfusion.com> - 1:2.1.2-2
|
* Mon Jan 9 2023 zhangliangpengkun<zhangliangpengkun@xfusion.com> - 1:2.1.2-2
|
||||||
- Fix linting error.
|
- Fix linting error
|
||||||
|
|
||||||
* Thu Jun 23 2022 houyingchao <houyingchao@h-partners.com> - 1:2.1.2-1
|
* Thu Jun 23 2022 houyingchao <houyingchao@h-partners.com> - 1:2.1.2-1
|
||||||
- Upgrade to 2.1.2 version
|
- Upgrade to 2.1.2 version
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user