Changes between Version 2 and Version 3 of Ticket #35245, comment 4


Ignore:
Timestamp:
Feb 23, 2024, 2:36:50 AM (9 months ago)
Author:
willzhao

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35245, comment 4

    v2 v3  
    77        instance = await asyncio.gather(SimpleModel.objects.filter(field=4).afirst())
    88        self.assertIsNone(instance[0])
     9    async def test_afirst_gather_my_provider(self):
     10        class MyProvider:
     11            async def get(self) -> list[str]:
     12                print("afirst inside gather")
     13                res = await SimpleModel.objects.afirst()
     14                print("afirst inside gather done")
     15                return res
     16        instance = await asyncio.gather(*[MyProvider().get()])
     17        self.assertEqual(instance[0], self.s1)
    918}}}
    1019This UT works fine so I think the issue is not related to asyncio.gather and async ORM call.
Back to Top