Browse files

Edited MySQL-specific check messages for grammar and consistency.

  • Loading branch information...
1 parent 55ba92a commit f7587b20da822912f65ba07cd3a5f02076f97338 @freakboy3742 freakboy3742 committed Mar 3, 2014
Showing with 4 additions and 6 deletions.
  1. +2 −3 django/db/backends/mysql/validation.py
  2. +2 −3 tests/invalid_models_tests/test_ordinary_fields.py
View
5 django/db/backends/mysql/validation.py
@@ -22,11 +22,10 @@ def check_field(self, field, **kwargs):
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
View
5 tests/invalid_models_tests/test_ordinary_fields.py
@@ -191,11 +191,10 @@ class Model(models.Model):
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)

0 comments on commit f7587b2

Please sign in to comment.