diff options
| author | Andrew Godwin <andrew@aeracode.org> | 2020-02-12 15:15:00 -0700 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-03-18 19:59:12 +0100 |
| commit | fc0fa72ff4cdbf5861a366e31cb8bbacd44da22d (patch) | |
| tree | d419ce531586808b0a111664907b859cb6d22862 /django/test/testcases.py | |
| parent | 3f7e4b16bf58f99c71570ba75dc97db8265071be (diff) | |
Fixed #31224 -- Added support for asynchronous views and middleware.
This implements support for asynchronous views, asynchronous tests,
asynchronous middleware, and an asynchronous test client.
Diffstat (limited to 'django/test/testcases.py')
| -rw-r--r-- | django/test/testcases.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py index 2c24708a3b..7ebddf80e5 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -33,7 +33,7 @@ from django.db import DEFAULT_DB_ALIAS, connection, connections, transaction from django.forms.fields import CharField from django.http import QueryDict from django.http.request import split_domain_port, validate_host -from django.test.client import Client +from django.test.client import AsyncClient, Client from django.test.html import HTMLParseError, parse_html from django.test.signals import setting_changed, template_rendered from django.test.utils import ( @@ -151,6 +151,7 @@ class SimpleTestCase(unittest.TestCase): # The class we'll use for the test client self.client. # Can be overridden in derived classes. client_class = Client + async_client_class = AsyncClient _overridden_settings = None _modified_settings = None @@ -292,6 +293,7 @@ class SimpleTestCase(unittest.TestCase): * Clear the mail test outbox. """ self.client = self.client_class() + self.async_client = self.async_client_class() mail.outbox = [] def _post_teardown(self): |
