diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2014-03-03 14:31:55 +0800 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2014-03-03 14:31:55 +0800 |
| commit | f7587b20da822912f65ba07cd3a5f02076f97338 (patch) | |
| tree | 02635e537719f02032a5cd77bb946e0f1ae9b8b7 | |
| parent | 55ba92a9c9fc22ce5482c1a7d18ffb0003be2b80 (diff) | |
Edited MySQL-specific check messages for grammar and consistency.
| -rw-r--r-- | django/db/backends/mysql/validation.py | 5 | ||||
| -rw-r--r-- | tests/invalid_models_tests/test_ordinary_fields.py | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/django/db/backends/mysql/validation.py b/django/db/backends/mysql/validation.py index 4ee701583a..cd7503a352 100644 --- a/django/db/backends/mysql/validation.py +++ b/django/db/backends/mysql/validation.py @@ -22,11 +22,10 @@ class DatabaseValidation(BaseDatabaseValidation): and (field.max_length is None or int(field.max_length) > 255)): errors.append( checks.Error( - ('Under mysql backend, the field cannot have a "max_length" ' - 'greated than 255 when it is unique.'), + ('MySQL does not allow unique CharFields to have a max_length > 255.'), hint=None, obj=field, - id='E047', + id='mysql.E001', ) ) return errors diff --git a/tests/invalid_models_tests/test_ordinary_fields.py b/tests/invalid_models_tests/test_ordinary_fields.py index 5cbc5005ae..72e19b108d 100644 --- a/tests/invalid_models_tests/test_ordinary_fields.py +++ b/tests/invalid_models_tests/test_ordinary_fields.py @@ -191,11 +191,10 @@ class CharFieldTests(IsolatedModelsTestCase): errors = validator.check_field(field) expected = [ Error( - ('Under mysql backend, the field cannot have a "max_length" ' - 'greated than 255 when it is unique.'), + 'MySQL does not allow unique CharFields to have a max_length > 255.', hint=None, obj=field, - id='E047', + id='mysql.E001', ) ] self.assertEqual(errors, expected) |
