1
0
mirror of https://github.com/django/django.git synced 2025-06-08 13:09:13 +00:00

Refs #35444 -- Adjusted multi-args distinct aggregate test ordering expectations.

Unless an explicit order_by is specified for the test the ordering of the
aggregation results is undefined.
This commit is contained in:
Simon Charette 2025-05-23 01:00:29 -04:00 committed by Sarah Boyce
parent 1704c49a9b
commit ec7f0bcf79

View File

@ -576,7 +576,7 @@ class AggregateTestCase(TestCase):
books = Book.objects.aggregate(
ratings=StringAgg(Cast(F("rating"), CharField()), Value(","), distinct=True)
)
self.assertEqual(books["ratings"], "3,4,4.5,5")
self.assertCountEqual(books["ratings"].split(","), ["3", "4", "4.5", "5"])
@skipIfDBFeature("supports_aggregate_distinct_multiple_argument")
def test_raises_error_on_multiple_argument_distinct(self):