From b8f203b3f27b1dc02ad84b616092bcf03337fc51 Mon Sep 17 00:00:00 2001 From: Yoong Kang Lim Date: Mon, 20 Apr 2015 22:29:50 +1000 Subject: [PATCH] [1.8.x] Fixed #24667 --- Repaired model_fields cardinality test Backport of 36eab95e7fde7fad4368192ddbef4e2dbb32dc91 from master --- tests/model_fields/test_field_flags.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/model_fields/test_field_flags.py b/tests/model_fields/test_field_flags.py index e86ee3a528..18dcdcef91 100644 --- a/tests/model_fields/test_field_flags.py +++ b/tests/model_fields/test_field_flags.py @@ -146,10 +146,10 @@ class FieldFlagsTests(test.TestCase): self.assertEqual(1, true_cardinality_flags) def test_cardinality_m2m(self): - m2m_type_fields = ( + m2m_type_fields = [ f for f in self.all_fields if f.is_relation and f.many_to_many - ) + ] # Test classes are what we expect self.assertEqual(MANY_TO_MANY_CLASSES, {f.__class__ for f in m2m_type_fields})