summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2022-04-27 11:30:43 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-05-02 10:52:33 +0200
commit271a8e73ee382bb487d15e97ffaa675d78869413 (patch)
treec85f3ca863810dd3100578db7e9d2058f887b4f9 /tests
parent77926176b281b9c553c934e52acdd1c0377ea601 (diff)
Refs #33646 -- Made QuerySet.raw() async-compatible.
Diffstat (limited to 'tests')
-rw-r--r--tests/async_queryset/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/async_queryset/tests.py b/tests/async_queryset/tests.py
index f600cfe392..792797fb9d 100644
--- a/tests/async_queryset/tests.py
+++ b/tests/async_queryset/tests.py
@@ -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])