Relaxed some query ordering assertions in expressions tests.
It accounts for differences seen on CockroachDB.
This commit is contained in:
parent
3b1746d519
commit
afcad0f1b1
|
@ -777,26 +777,26 @@ class BasicExpressionsTests(TestCase):
|
||||||
output_field=BooleanField(),
|
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):
|
def test_boolean_expression_combined(self):
|
||||||
is_ceo = Company.objects.filter(ceo=OuterRef('pk'))
|
is_ceo = Company.objects.filter(ceo=OuterRef('pk'))
|
||||||
is_poc = Company.objects.filter(point_of_contact=OuterRef('pk'))
|
is_poc = Company.objects.filter(point_of_contact=OuterRef('pk'))
|
||||||
self.gmbh.point_of_contact = self.max
|
self.gmbh.point_of_contact = self.max
|
||||||
self.gmbh.save()
|
self.gmbh.save()
|
||||||
self.assertSequenceEqual(
|
self.assertCountEqual(
|
||||||
Employee.objects.filter(Exists(is_ceo) | Exists(is_poc)),
|
Employee.objects.filter(Exists(is_ceo) | Exists(is_poc)),
|
||||||
[self.example_inc.ceo, self.foobar_ltd.ceo, self.max],
|
[self.example_inc.ceo, self.foobar_ltd.ceo, self.max],
|
||||||
)
|
)
|
||||||
self.assertSequenceEqual(
|
self.assertCountEqual(
|
||||||
Employee.objects.filter(Exists(is_ceo) & Exists(is_poc)),
|
Employee.objects.filter(Exists(is_ceo) & Exists(is_poc)),
|
||||||
[self.max],
|
[self.max],
|
||||||
)
|
)
|
||||||
self.assertSequenceEqual(
|
self.assertCountEqual(
|
||||||
Employee.objects.filter(Exists(is_ceo) & Q(salary__gte=30)),
|
Employee.objects.filter(Exists(is_ceo) & Q(salary__gte=30)),
|
||||||
[self.max],
|
[self.max],
|
||||||
)
|
)
|
||||||
self.assertSequenceEqual(
|
self.assertCountEqual(
|
||||||
Employee.objects.filter(Exists(is_poc) | Q(salary__lt=15)),
|
Employee.objects.filter(Exists(is_poc) | Q(salary__lt=15)),
|
||||||
[self.example_inc.ceo, self.max],
|
[self.example_inc.ceo, self.max],
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue