From 193cd097ca8f2cc6a911e57b8e3fb726f96ee6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anssi=20K=C3=A4=C3=A4ri=C3=A4inen?= Date: Sat, 28 Dec 2013 17:57:58 +0200 Subject: [PATCH] Fixed #11722 -- iexact=F() produced invalid SQL --- tests/expressions/tests.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py index 99f41024f8..0ea4df818c 100644 --- a/tests/expressions/tests.py +++ b/tests/expressions/tests.py @@ -224,6 +224,13 @@ class ExpressionsTests(TestCase): acme.num_employees = F("num_employees") + 16 self.assertRaises(TypeError, acme.save) + def test_ticket_11722_iexact_lookup(self): + Employee.objects.create(firstname="John", lastname="Doe") + Employee.objects.create(firstname="Test", lastname="test") + + queryset = Employee.objects.filter(firstname__iexact=F('lastname')) + self.assertQuerysetEqual(queryset, [""]) + def test_ticket_18375_join_reuse(self): # Test that reverse multijoin F() references and the lookup target # the same join. Pre #18375 the F() join was generated first, and the