mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[5.0.x] Fixed #35174 -- Fixed Signal.asend()/asend_robust() crash when all receivers are asynchronous.
Regression ine83a88566a. Backport of1b5338d03efrom main
This commit is contained in:
committed by
Mariusz Felisiak
parent
c22075af80
commit
761e913191
@@ -626,3 +626,19 @@ class AsyncReceiversTests(SimpleTestCase):
|
||||
(async_handler, 1),
|
||||
],
|
||||
)
|
||||
|
||||
async def test_asend_only_async_receivers(self):
|
||||
async_handler = AsyncHandler()
|
||||
signal = dispatch.Signal()
|
||||
signal.connect(async_handler)
|
||||
|
||||
result = await signal.asend(self.__class__)
|
||||
self.assertEqual(result, [(async_handler, 1)])
|
||||
|
||||
async def test_asend_robust_only_async_receivers(self):
|
||||
async_handler = AsyncHandler()
|
||||
signal = dispatch.Signal()
|
||||
signal.connect(async_handler)
|
||||
|
||||
result = await signal.asend_robust(self.__class__)
|
||||
self.assertEqual(result, [(async_handler, 1)])
|
||||
|
||||
Reference in New Issue
Block a user