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

Relaxed some query ordering assertions in various tests.

It accounts for differences seen on MySQL with MyISAM storage engine.
This commit is contained in:
Mariusz Felisiak
2022-04-14 12:12:13 +02:00
committed by GitHub
parent 08f30d1b6a
commit 1760ad4e8c
16 changed files with 55 additions and 49 deletions

View File

@@ -2070,7 +2070,7 @@ class ModelMultipleChoiceFieldTests(TestCase):
def test_model_multiple_choice_field(self):
f = forms.ModelMultipleChoiceField(Category.objects.all())
self.assertEqual(
self.assertCountEqual(
list(f.choices),
[
(self.c1.pk, "Entertainment"),
@@ -2139,7 +2139,7 @@ class ModelMultipleChoiceFieldTests(TestCase):
# queryset can be changed after the field is created.
f.queryset = Category.objects.exclude(name="Third")
self.assertEqual(
self.assertCountEqual(
list(f.choices),
[(self.c1.pk, "Entertainment"), (self.c2.pk, "It's a test")],
)
@@ -2151,7 +2151,7 @@ class ModelMultipleChoiceFieldTests(TestCase):
f.queryset = Category.objects.all()
f.label_from_instance = lambda obj: "multicategory " + str(obj)
self.assertEqual(
self.assertCountEqual(
list(f.choices),
[
(self.c1.pk, "multicategory Entertainment"),