diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-04-27 11:30:43 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-05-02 10:52:33 +0200 |
| commit | 271a8e73ee382bb487d15e97ffaa675d78869413 (patch) | |
| tree | c85f3ca863810dd3100578db7e9d2058f887b4f9 /tests | |
| parent | 77926176b281b9c553c934e52acdd1c0377ea601 (diff) | |
Refs #33646 -- Made QuerySet.raw() async-compatible.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/async_queryset/tests.py | 5 |
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]) |
