I suggest multilining this string to make it more readable, something like:
```
checks.Error(
    'Autogenerated column name too long for field "%s". '
    'Maximum length is "%s" for database alias "%s".' % (
        column_name,
        allowed_len,
        DEFAULT_DB_ALIAS
    ),
    hint='Set the column name manually using db_column',
    obj=cls,
)
```
(same idea in the test)