Fixed #26154 -- Deprecated CommaSeparatedIntegerField

This commit is contained in:
Brobin 2016-02-07 17:22:48 -06:00 committed by Tim Graham
parent f7a9872b91
commit dca8b916ff
6 changed files with 62 additions and 1 deletions

View file

@ -21,3 +21,20 @@ class DeprecatedFieldsTests(SimpleTestCase):
id='fields.E900',
)],
)
def test_CommaSeparatedIntegerField_deprecated(self):
class CommaSeparatedIntegerModel(models.Model):
csi = models.CommaSeparatedIntegerField(max_length=64)
model = CommaSeparatedIntegerModel()
self.assertEqual(
model.check(),
[checks.Warning(
'CommaSeparatedIntegerField has been deprecated. Support '
'for it (except in historical migrations) will be removed '
'in Django 2.0.',
hint='Use CharField(validators=[validate_comma_separated_integer_list]) instead.',
obj=CommaSeparatedIntegerModel._meta.get_field('csi'),
id='fields.W901',
)],
)