diff options
author | Carlton Gibson <carlton.gibson@noumenal.es> | 2023-03-08 09:53:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-08 09:53:25 +0100 |
commit | 9b224579875e30203d079cc2fee83b116d98eb78 (patch) | |
tree | 2c94f6eb06a4ebe53e5ec3321456e3e6b9e00873 /tests/signals | |
parent | 279e611c017b5fcc055263e760de1495a9098ede (diff) | |
download | django-9b224579875e30203d079cc2fee83b116d98eb78.tar.gz |
Refs #32172 -- Used asgiref coroutine shim in async signals tests.
Bug in e83a88566a71a2353cebc35992c110be0f8628af.
Diffstat (limited to 'tests/signals')
-rw-r--r-- | tests/signals/tests.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/signals/tests.py b/tests/signals/tests.py index 0f161eeeb1..5558778bbe 100644 --- a/tests/signals/tests.py +++ b/tests/signals/tests.py @@ -1,6 +1,7 @@ -import asyncio from unittest import mock +from asgiref.sync import markcoroutinefunction + from django import dispatch from django.apps.registry import Apps from django.db import models @@ -543,9 +544,11 @@ class SyncHandler: class AsyncHandler: - _is_coroutine = asyncio.coroutines._is_coroutine param = 0 + def __init__(self): + markcoroutinefunction(self) + async def __call__(self, **kwargs): self.param += 1 return self.param |