'#13711 -- Model check for long column names
when database does not support long names.'

@unittest.skipIf((max_column_name_length is None), "The    database    doesn't    have    a    column    name    length    limit.")
def test_local_field_long_column_name(self):

    (allowed_len, db_alias) = get_max_column_name_length()
    class ModelWithLongField(models.Model, ):
        title = models.CharField(max_length=11)
    long_field_name = ('a' * (self.max_column_name_length + 1))
    long_field_name2 = ('b' * (self.max_column_name_length + 1))
    models.CharField(max_length=11).contribute_to_class(ModelWithLongField, long_field_name)
    models.CharField(max_length=11, db_column='vlmn').contribute_to_class(ModelWithLongField, long_field_name2)
    self.assertEqual(ModelWithLongField.check(), [Error(('Autogenerated    column    name    too    long    for    field    "%s".    Maximum    length    is    "%s"    for    database    "%s".' % (long_field_name, self.max_column_name_length, self.column_limit_db_alias)), hint="Set    the    column    name    manually    using    'db_column'.", obj=ModelWithLongField, id='models.E018')])
