diff --git a/tests/aggregation/tests.py b/tests/aggregation/tests.py index 0f799c4bc3..a93c39e3d5 100644 --- a/tests/aggregation/tests.py +++ b/tests/aggregation/tests.py @@ -440,7 +440,7 @@ class AggregateTestCase(TestCase): def test_fkey_aggregate(self): explicit = list(Author.objects.annotate(Count('book__id'))) implicit = list(Author.objects.annotate(Count('book'))) - self.assertEqual(explicit, implicit) + self.assertCountEqual(explicit, implicit) def test_annotate_ordering(self): books = Book.objects.values('rating').annotate(oldest=Max('authors__age')).order_by('oldest', 'rating') diff --git a/tests/annotations/tests.py b/tests/annotations/tests.py index c39e8d3fbe..db4413564c 100644 --- a/tests/annotations/tests.py +++ b/tests/annotations/tests.py @@ -209,7 +209,7 @@ class NonAggregateAnnotationTestCase(TestCase): lengths = Employee.objects.annotate( name_len=Length('first_name'), ).distinct('name_len').values_list('name_len', flat=True) - self.assertSequenceEqual(lengths, [3, 7, 8]) + self.assertCountEqual(lengths, [3, 7, 8]) def test_filter_annotation(self): books = Book.objects.annotate( diff --git a/tests/expressions_window/tests.py b/tests/expressions_window/tests.py index 8102ffe621..580d038e29 100644 --- a/tests/expressions_window/tests.py +++ b/tests/expressions_window/tests.py @@ -699,7 +699,7 @@ class WindowFunctionTests(TestCase): highest=Window(FirstValue('id'), partition_by=F('department'), order_by=F('salary').desc()) ).values('highest') highest_salary = Employee.objects.filter(pk__in=subquery_qs) - self.assertSequenceEqual(highest_salary.values('department', 'salary'), [ + self.assertCountEqual(highest_salary.values('department', 'salary'), [ {'department': 'Accounting', 'salary': 50000}, {'department': 'Sales', 'salary': 55000}, {'department': 'Marketing', 'salary': 40000},