1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #14611 -- Added query_params argument to RequestFactory and Client classes.

This commit is contained in:
Tom Carrick
2023-11-05 16:41:16 +01:00
committed by Mariusz Felisiak
parent e76cc93b01
commit a03593967f
6 changed files with 434 additions and 82 deletions

View File

@@ -224,6 +224,17 @@ Tests
* The Django test runner now supports a ``--screenshots`` option to save
screenshots for Selenium tests.
* The :class:`~django.test.RequestFactory`,
:class:`~django.test.AsyncRequestFactory`, :class:`~django.test.Client`, and
:class:`~django.test.AsyncClient` classes now support the ``query_params``
parameter, which accepts a dictionary of query string keys and values. This
allows setting query strings on any HTTP methods more easily.
.. code-block:: python
self.client.post("/items/1", query_params={"action": "delete"})
await self.async_client.post("/items/1", query_params={"action": "delete"})
URLs
~~~~