Fixed #13711, #13528 -- Fixed problems in autogeneration and autotruncat...

...ion.
Well what you say is fine, but honestly I feel no need to add the check for `allowed_len` being `None`.
Checking for `supports_long_model_names` is correct and sufficient because in any db if it does not support long names it will have limit. If you see `connection.ops.max_name_length()`, the length returned is the exact value of the database limit being returned explicitly so that function will give me exact value whether it supports long name or not. I have used this condition just to make sure that those dbs which allow auto-truncation as in `postgres` can skip the test and those which have `allowed_len=None` will be covered by it automatically.
`supports_long_model_names` is set to False for only the db with limited length and no auto-truncation.