From 33c06ca0da6c4f151b84e5d8c305faff9ca30d98 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Wed, 13 Mar 2024 17:46:37 +0100 Subject: Refs #32673, Refs #35295 -- Avoided wrapping rhs direct values in lookups. --- tests/lookup/tests.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') 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 -- cgit v1.3