--
Ticket URL: <https://code.djangoproject.com/ticket/33228>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/33228#comment:1>
* owner: nobody => Chinmoy
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/33228#comment:2>
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>
Comment (by Tim Graham):
You should add `has_case_insensitive_like = True` to the sqlite3 backend
(and remove the now unneeded `has_case_insensitive_like = False` from the
others).
--
Ticket URL: <https://code.djangoproject.com/ticket/33228#comment:4>
* has_patch: 0 => 1
* stage: Accepted => Ready for checkin
Comment:
[https://github.com/django/django/pull/15030 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/33228#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"073b7b5915fdfb89a144e81173176ee13ff92a25" 073b7b59]:
{{{
#!CommitTicketReference repository=""
revision="073b7b5915fdfb89a144e81173176ee13ff92a25"
Fixed #33228 -- Changed value of
BaseDatabaseFeatures.has_case_insensitive_like to False.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33228#comment:6>