diff options
| author | David Wobrock <david.wobrock@gmail.com> | 2022-11-10 09:29:49 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-11-10 10:08:42 +0100 |
| commit | 8c8427c35ee82648e81eb4982a4e04ccea9edd5c (patch) | |
| tree | bb17d322ed9938f954b3a054a8c52a8cad417467 /docs/topics/testing/tools.txt | |
| parent | 9fb57fcc703749269987f54f9ee1d71bd9a2dbca (diff) | |
[4.1.x] Improved async request factory and client docs.
Backport of 0931d5b087a37545af0bef597deac03b5f0f7db0 from main
Diffstat (limited to 'docs/topics/testing/tools.txt')
| -rw-r--r-- | docs/topics/testing/tools.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt index c4f64fef94..f9764998ca 100644 --- a/docs/topics/testing/tools.txt +++ b/docs/topics/testing/tools.txt @@ -1906,9 +1906,13 @@ If you are testing from an asynchronous function, you must also use the asynchronous test client. This is available as ``django.test.AsyncClient``, or as ``self.async_client`` on any test. +.. class:: AsyncClient(enforce_csrf_checks=False, raise_request_exception=True, **defaults) + ``AsyncClient`` has the same methods and signatures as the synchronous (normal) test client, with two exceptions: +* In the initialization, arbitrary keyword arguments in ``defaults`` are added + directly into the ASGI scope. * The ``follow`` parameter is not supported. * Headers passed as ``extra`` keyword arguments should not have the ``HTTP_`` prefix required by the synchronous client (see :meth:`Client.get`). For |
