浏览代码

Refs #32172 -- Used asgiref coroutine shim in async signals tests.

Bug in e83a88566a71a2353cebc35992c110be0f8628af.
Carlton Gibson 2 年之前
父节点
当前提交
9b22457987
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      tests/signals/tests.py

+ 5 - 2
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