mirror of
https://github.com/django/django.git
synced 2025-10-08 09:40:35 +00:00
Refs #33646 -- Made QuerySet.raw() async-compatible.
This commit is contained in:
parent
77926176b2
commit
271a8e73ee
2 changed files with 21 additions and 0 deletions
|
@ -225,3 +225,8 @@ class AsyncQuerySetTest(TestCase):
|
|||
json.loads(result)
|
||||
except json.JSONDecodeError as e:
|
||||
self.fail(f"QuerySet.aexplain() result is not valid JSON: {e}")
|
||||
|
||||
async def test_raw(self):
|
||||
sql = "SELECT id, field FROM async_queryset_simplemodel WHERE created=%s"
|
||||
qs = SimpleModel.objects.raw(sql, [self.s1.created])
|
||||
self.assertEqual([o async for o in qs], [self.s1])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue