diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-03-13 17:46:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-13 17:46:37 +0100 |
| commit | 33c06ca0da6c4f151b84e5d8c305faff9ca30d98 (patch) | |
| tree | 4e2d85aec57d1d387f279da62d7b523f0f131ab9 /tests | |
| parent | 80fe2f439102dc748ff8ddd661d94935915bd3e7 (diff) | |
Refs #32673, Refs #35295 -- Avoided wrapping rhs direct values in lookups.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/lookup/tests.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/lookup/tests.py b/tests/lookup/tests.py index a198a13b62..ebdaa21e3d 100644 --- a/tests/lookup/tests.py +++ b/tests/lookup/tests.py @@ -1366,6 +1366,12 @@ class LookupTests(TestCase): [stock_1, stock_2], ) + def test_lookup_direct_value_rhs_unwrapped(self): + with self.assertNumQueries(1) as ctx: + self.assertIs(Author.objects.filter(GreaterThan(2, 1)).exists(), True) + # Direct values on RHS are not wrapped. + self.assertIn("2 > 1", ctx.captured_queries[0]["sql"]) + class LookupQueryingTests(TestCase): @classmethod |
