mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #27203 -- Replaced assertQuerysetEqual(..., lambda o: o) with assertSequenceEqual().
This commit is contained in:
@@ -116,16 +116,10 @@ class DistinctOnTests(TestCase):
|
||||
def test_distinct_on_in_ordered_subquery(self):
|
||||
qs = Staff.objects.distinct('name').order_by('name', 'id')
|
||||
qs = Staff.objects.filter(pk__in=qs).order_by('name')
|
||||
self.assertQuerysetEqual(
|
||||
qs, [self.p1_o1, self.p2_o1, self.p3_o1],
|
||||
lambda x: x
|
||||
)
|
||||
self.assertSequenceEqual(qs, [self.p1_o1, self.p2_o1, self.p3_o1])
|
||||
qs = Staff.objects.distinct('name').order_by('name', '-id')
|
||||
qs = Staff.objects.filter(pk__in=qs).order_by('name')
|
||||
self.assertQuerysetEqual(
|
||||
qs, [self.p1_o2, self.p2_o1, self.p3_o1],
|
||||
lambda x: x
|
||||
)
|
||||
self.assertSequenceEqual(qs, [self.p1_o2, self.p2_o1, self.p3_o1])
|
||||
|
||||
def test_distinct_on_get_ordering_preserved(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user