diff options
author | Christopher Wang <dev@christopher.wang> | 2020-11-03 22:15:17 -0800 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-11-04 22:31:57 +0100 |
commit | 2f6312fcd13a6dd6b62393663b75b230f2e1bc96 (patch) | |
tree | edd7569f48785132ac3970c14b1f89a9551b63f7 /tests | |
parent | 77e93d3b207ec3ea00e75d54f2b65b2cde6dd0a8 (diff) | |
download | django-2f6312fcd13a6dd6b62393663b75b230f2e1bc96.tar.gz |
Fixed #32168 -- Removed serial pk assumption in aggregation_regress tests.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/aggregation_regress/tests.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/aggregation_regress/tests.py b/tests/aggregation_regress/tests.py index 29ffe1f058..877e7b49a7 100644 --- a/tests/aggregation_regress/tests.py +++ b/tests/aggregation_regress/tests.py @@ -876,7 +876,7 @@ class AggregationTests(TestCase): ) # 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( sorted(p.name for p in publishers), [ @@ -1450,8 +1450,10 @@ class AggregationTests(TestCase): query = Book.objects.annotate(Count('authors')).filter( q1 | q2).order_by('pk') self.assertQuerysetEqual( - query, [1, 4, 5, 6], - lambda b: b.pk) + query, + [self.b1.pk, self.b4.pk, self.b5.pk, self.b6.pk], + attrgetter('pk'), + ) def test_ticket_11293_q_immutable(self): """ |