summaryrefslogtreecommitdiff
path: root/tests/model_forms/tests.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2022-04-14 12:12:13 +0200
committerGitHub <noreply@github.com>2022-04-14 12:12:13 +0200
commit1760ad4e8cdbf34a0f38deae300460a0b9c38eac (patch)
tree1815c8c1f40069c434fb38e2487036afd64bece5 /tests/model_forms/tests.py
parent08f30d1b6ac9b7bc05857f88a70277d5ceb27ba1 (diff)
Relaxed some query ordering assertions in various tests.
It accounts for differences seen on MySQL with MyISAM storage engine.
Diffstat (limited to 'tests/model_forms/tests.py')
-rw-r--r--tests/model_forms/tests.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py
index 0d54cead70..a8617444c5 100644
--- a/tests/model_forms/tests.py
+++ b/tests/model_forms/tests.py
@@ -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"),