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

Refs #24227 -- Replaced M2M isinstance checks by field.many_to_many

Thanks Markus Holtermann, Collin Anderson and Tim Graham for the reviews.
This commit is contained in:
Claude Paroz
2016-03-10 18:21:25 +01:00
parent 2b3a941457
commit 983c158da7
10 changed files with 40 additions and 57 deletions

View File

@@ -633,7 +633,7 @@ class RawIdCheckTests(CheckTestCase):
self.assertIsInvalid(
ValidationTestModelAdmin, ValidationTestModel,
"The value of 'raw_id_fields[0]' must be a ForeignKey or ManyToManyField.",
"The value of 'raw_id_fields[0]' must be a foreign key or a many-to-many field.",
'admin.E003')
def test_valid_case(self):
@@ -826,7 +826,7 @@ class FilterVerticalCheckTests(CheckTestCase):
self.assertIsInvalid(
ValidationTestModelAdmin, ValidationTestModel,
"The value of 'filter_vertical[0]' must be a ManyToManyField.",
"The value of 'filter_vertical[0]' must be a many-to-many field.",
'admin.E020')
def test_valid_case(self):
@@ -863,7 +863,7 @@ class FilterHorizontalCheckTests(CheckTestCase):
self.assertIsInvalid(
ValidationTestModelAdmin, ValidationTestModel,
"The value of 'filter_horizontal[0]' must be a ManyToManyField.",
"The value of 'filter_horizontal[0]' must be a many-to-many field.",
'admin.E020')
def test_valid_case(self):
@@ -960,7 +960,7 @@ class PrepopulatedFieldsCheckTests(CheckTestCase):
self.assertIsInvalid(
ValidationTestModelAdmin, ValidationTestModel,
("The value of 'prepopulated_fields' refers to 'users', which must not be "
"a DateTimeField, ForeignKey or ManyToManyField."),
"a DateTimeField, a foreign key, or a many-to-many field."),
'admin.E028')
def test_valid_case(self):
@@ -998,7 +998,7 @@ class ListDisplayTests(CheckTestCase):
self.assertIsInvalid(
ValidationTestModelAdmin, ValidationTestModel,
"The value of 'list_display[0]' must not be a ManyToManyField.",
"The value of 'list_display[0]' must not be a many-to-many field.",
'admin.E109')
def test_valid_case(self):