1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Refs #36648 -- Removed hardcoded pk in CompositePKAggregateTests.

This commit is contained in:
Jacob Walls
2025-10-15 22:18:33 -04:00
parent 37df013195
commit bee64561a6

View File

@@ -145,13 +145,13 @@ class CompositePKAggregateTests(TestCase):
def test_first_from_unordered_queryset_aggregation_pk_selected(self): def test_first_from_unordered_queryset_aggregation_pk_selected(self):
self.assertEqual( self.assertEqual(
Comment.objects.values("pk").annotate(max=Max("id")).first(), Comment.objects.values("pk").annotate(max=Max("id")).first(),
{"pk": (1, 1), "max": 1}, {"pk": (self.comment_1.tenant_id, 1), "max": 1},
) )
def test_first_from_unordered_queryset_aggregation_pk_selected_separately(self): def test_first_from_unordered_queryset_aggregation_pk_selected_separately(self):
self.assertEqual( self.assertEqual(
Comment.objects.values("tenant", "id").annotate(max=Max("id")).first(), Comment.objects.values("tenant", "id").annotate(max=Max("id")).first(),
{"tenant": 1, "id": 1, "max": 1}, {"tenant": self.comment_1.tenant_id, "id": 1, "max": 1},
) )
def test_first_from_unordered_queryset_aggregation_pk_incomplete(self): def test_first_from_unordered_queryset_aggregation_pk_incomplete(self):