diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-04-06 08:03:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-06 08:03:43 +0200 |
commit | 78fea27f690028204c03c28d821cb0c0240a7398 (patch) | |
tree | 492f4fc09abc301dc92c6e3739aad908c3a012fc /tests/middleware_exceptions | |
parent | 0f7afd6599fd4191231a8897258807c8c24deedf (diff) | |
download | django-78fea27f690028204c03c28d821cb0c0240a7398.tar.gz |
Fixed #32614 -- Fixed MiddlewareSyncAsyncTests tests with asgiref 3.3.2+.
Diffstat (limited to 'tests/middleware_exceptions')
-rw-r--r-- | tests/middleware_exceptions/middleware.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/middleware_exceptions/middleware.py b/tests/middleware_exceptions/middleware.py index 9fb9726b50..b87da84b9d 100644 --- a/tests/middleware_exceptions/middleware.py +++ b/tests/middleware_exceptions/middleware.py @@ -1,3 +1,5 @@ +import asyncio + from django.http import Http404, HttpResponse from django.template import engines from django.template.response import TemplateResponse @@ -11,6 +13,9 @@ log = [] class BaseMiddleware: def __init__(self, get_response): self.get_response = get_response + if asyncio.iscoroutinefunction(self.get_response): + # Mark the class as async-capable. + self._is_coroutine = asyncio.coroutines._is_coroutine def __call__(self, request): return self.get_response(request) |