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:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user