diff options
Diffstat (limited to 'docs/topics/testing/advanced.txt')
| -rw-r--r-- | docs/topics/testing/advanced.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/topics/testing/advanced.txt b/docs/topics/testing/advanced.txt index a909c5f3d8..8aca92ea36 100644 --- a/docs/topics/testing/advanced.txt +++ b/docs/topics/testing/advanced.txt @@ -67,6 +67,17 @@ The following is a unit test using the request factory:: response = MyView.as_view()(request) self.assertEqual(response.status_code, 200) +AsyncRequestFactory +------------------- + +``RequestFactory`` creates WSGI-like requests. If you want to create ASGI-like +requests, including having a correct ASGI ``scope``, you can instead use +``django.test.AsyncRequestFactory``. + +This class is directly API-compatible with ``RequestFactory``, with the only +difference being that it returns ``ASGIRequest`` instances rather than +``WSGIRequest`` instances. All of its methods are still synchronous callables. + Testing class-based views ========================= |
