From afcad0f1b18ad6a2068a405b06fa7468a85fddf2 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 19 Oct 2020 13:21:31 -0400 Subject: [PATCH] Relaxed some query ordering assertions in expressions tests. It accounts for differences seen on CockroachDB. --- tests/expressions/tests.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py index 0da90553e4..ceeed3aeb1 100644 --- a/tests/expressions/tests.py +++ b/tests/expressions/tests.py @@ -777,26 +777,26 @@ class BasicExpressionsTests(TestCase): output_field=BooleanField(), ), ) - self.assertSequenceEqual(qs, [self.example_inc.ceo, self.foobar_ltd.ceo, self.max]) + self.assertCountEqual(qs, [self.example_inc.ceo, self.foobar_ltd.ceo, self.max]) def test_boolean_expression_combined(self): is_ceo = Company.objects.filter(ceo=OuterRef('pk')) is_poc = Company.objects.filter(point_of_contact=OuterRef('pk')) self.gmbh.point_of_contact = self.max self.gmbh.save() - self.assertSequenceEqual( + self.assertCountEqual( Employee.objects.filter(Exists(is_ceo) | Exists(is_poc)), [self.example_inc.ceo, self.foobar_ltd.ceo, self.max], ) - self.assertSequenceEqual( + self.assertCountEqual( Employee.objects.filter(Exists(is_ceo) & Exists(is_poc)), [self.max], ) - self.assertSequenceEqual( + self.assertCountEqual( Employee.objects.filter(Exists(is_ceo) & Q(salary__gte=30)), [self.max], ) - self.assertSequenceEqual( + self.assertCountEqual( Employee.objects.filter(Exists(is_poc) | Q(salary__lt=15)), [self.example_inc.ceo, self.max], )