Ticket #11722: iexact_regression.diff

File iexact_regression.diff, 700 bytes (added by Ubercore, 4 years ago)

Simple test illustrating the issue

  • tests/modeltests/expressions/tests.py

    diff --git a/tests/modeltests/expressions/tests.py b/tests/modeltests/expressions/tests.py
    index 0a136ae..cddb99b 100644
    a b class ExpressionsTests(TestCase): 
    216216        )
    217217        acme.num_employees = F("num_employees") + 16
    218218        self.assertRaises(TypeError, acme.save)
     219
     220    def test_iexact_lookup(self):
     221        Employee.objects.create(firstname="John", lastname="Doe")
     222        Employee.objects.create(firstname="Test", lastname="test")
     223        queryset = Employee.objects.filter(firstname__iexact=F('lastname'))
     224        self.assertQuerysetEqual(queryset, ["<Employee: Test test>"])
     225
Back to Top