Skip to content
Myr

Fix incorrect references to query in testing doc

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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.

authored by Nick Kocharhook · committed by GitHub · parent 21d32ee · Browse files · 1 file+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:docs/testing.rst+4 added-4 removed
90 unmodified lines
91The ``client`` has methods that match the common HTTP request methods,92such as ``client.get()`` and ``client.post()``. They take many arguments93for building the request; you can find the full documentation in94:class:`~werkzeug.test.EnvironBuilder`. Typically you'll use ``path``,95``query``, ``headers``, and ``data`` or ``json``.95``query_string``, ``headers``, and ``data`` or ``json``.9697To make a request, call the method the request should use with the path98to the route to test. A :class:`~werkzeug.test.TestResponse` is returned99to examine the response data. It has all the usual properties of a
7 unmodified lines
107 response = client.get("/posts")108 assert b"<h2>Hello, World!</h2>" in response.data109110111Pass a dict ``query={"key": "value", ...}`` to set arguments in the112query string (after the ``?`` in the URL). Pass a dict ``headers={}``113to set request headers.111Pass a dict ``query_string={"key": "value", ...}`` to set arguments in112the query string (after the ``?`` in the URL). Pass a dict113``headers={}`` to set request headers.114115To send a request body in a POST or PUT request, pass a value to116``data``. If raw bytes are passed, that exact body is used. Usually,117you'll pass a dict to set form data.
202 unmodified lines