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

[6.0.x] Refs #36648 -- Removed hardcoded pk in CompositePKAggregateTests.

Backport of bee64561a6 from main.
This commit is contained in:
Jacob Walls
2025-10-15 22:18:33 -04:00
parent 5c114ce2d8
commit 2cc90728de

View File

@@ -145,13 +145,13 @@ class CompositePKAggregateTests(TestCase):
def test_first_from_unordered_queryset_aggregation_pk_selected(self):
self.assertEqual(
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):
self.assertEqual(
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):