From f7587b20da822912f65ba07cd3a5f02076f97338 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Mon, 3 Mar 2014 14:31:55 +0800 Subject: [PATCH] Edited MySQL-specific check messages for grammar and consistency. --- django/db/backends/mysql/validation.py | 5 ++--- 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)