Fixed #32168 -- Removed serial pk assumption in aggregation_regress tests.

This commit is contained in:
Christopher Wang 2020-11-03 22:15:17 -08:00 committed by Mariusz Felisiak
parent 77e93d3b20
commit 2f6312fcd1
1 changed files with 5 additions and 3 deletions

View File

@ -876,7 +876,7 @@ class AggregationTests(TestCase):
) )
# Note: intentionally no order_by(), that case needs tests, too. # Note: intentionally no order_by(), that case needs tests, too.
publishers = Publisher.objects.filter(id__in=[1, 2]) publishers = Publisher.objects.filter(id__in=[self.p1.id, self.p2.id])
self.assertEqual( self.assertEqual(
sorted(p.name for p in publishers), sorted(p.name for p in publishers),
[ [
@ -1450,8 +1450,10 @@ class AggregationTests(TestCase):
query = Book.objects.annotate(Count('authors')).filter( query = Book.objects.annotate(Count('authors')).filter(
q1 | q2).order_by('pk') q1 | q2).order_by('pk')
self.assertQuerysetEqual( self.assertQuerysetEqual(
query, [1, 4, 5, 6], query,
lambda b: b.pk) [self.b1.pk, self.b4.pk, self.b5.pk, self.b6.pk],
attrgetter('pk'),
)
def test_ticket_11293_q_immutable(self): def test_ticket_11293_q_immutable(self):
""" """