#33228: Change BaseDatabaseFeatures.has_case_insensitive_like to False
-------------------------------------+-------------------------------------
     Reporter:  Tim Graham           |                    Owner:  Chinmoy
         Type:                       |                   Status:  assigned
  Cleanup/optimization               |
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Chinmoy):

 I was going through the code and after changing the value to `False`, one
 of the tests seemed to fail.

 {{{
    def test_ticket_16731_startswith_lookup(self):
         Employee.objects.create(firstname="John", lastname="Doe")
         e2 = Employee.objects.create(firstname="Jack", lastname="Jackson")
         e3 = Employee.objects.create(firstname="Jack", lastname="jackson")
         self.assertSequenceEqual(
             Employee.objects.filter(lastname__startswith=F('firstname')),
             [e2, e3] if connection.features.has_case_insensitive_like else
 [e2]
         )
 }}}

 with the error `AssertionError: Sequences differ: <QuerySet [<Employee:
 Jack Jackson>, <Employee: Jack jackson>]> != [<Employee: Jack Jackson>]`.
 I don't understand why the query filter returns `<QuerySet [<Employee:
 Jack Jackson>, <Employee: Jack jackson>]>` when the default value of
 `has_case_insensitive_like` is set to `False`? @Mariusz Felisiak any
 suggestion on this?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33228#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.ba6da0faf0bdaf506d4addfb2dc1a147%40djangoproject.com.

Reply via email to