Fixed #13711 -- Model check added to ensure that auto-generated field name is within limits of the database.

...ion.
I have done nesting because I need to calculate `allowed_len` before the test starts and I need model for that. So I create a Model in a test and calculate `allowed_len` and then using that I run the nested test.