mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #30400 -- Improved typography of user facing strings.
Thanks Claude Paroz for assistance with translations.
This commit is contained in:
parent
2b03e8e9e8
commit
42b9a23267
64 changed files with 195 additions and 195 deletions
|
@ -13,49 +13,49 @@ class ValidationMessagesTest(TestCase):
|
|||
|
||||
def test_autofield_field_raises_error_message(self):
|
||||
f = models.AutoField(primary_key=True)
|
||||
self._test_validation_messages(f, 'fõo', ["'fõo' value must be an integer."])
|
||||
self._test_validation_messages(f, 'fõo', ['“fõo” value must be an integer.'])
|
||||
|
||||
def test_integer_field_raises_error_message(self):
|
||||
f = models.IntegerField()
|
||||
self._test_validation_messages(f, 'fõo', ["'fõo' value must be an integer."])
|
||||
self._test_validation_messages(f, 'fõo', ['“fõo” value must be an integer.'])
|
||||
|
||||
def test_boolean_field_raises_error_message(self):
|
||||
f = models.BooleanField()
|
||||
self._test_validation_messages(f, 'fõo', ["'fõo' value must be either True or False."])
|
||||
self._test_validation_messages(f, 'fõo', ['“fõo” value must be either True or False.'])
|
||||
|
||||
def test_nullable_boolean_field_raises_error_message(self):
|
||||
f = models.BooleanField(null=True)
|
||||
self._test_validation_messages(f, 'fõo', ["'fõo' value must be either True, False, or None."])
|
||||
self._test_validation_messages(f, 'fõo', ['“fõo” value must be either True, False, or None.'])
|
||||
|
||||
def test_float_field_raises_error_message(self):
|
||||
f = models.FloatField()
|
||||
self._test_validation_messages(f, 'fõo', ["'fõo' value must be a float."])
|
||||
self._test_validation_messages(f, 'fõo', ['“fõo” value must be a float.'])
|
||||
|
||||
def test_decimal_field_raises_error_message(self):
|
||||
f = models.DecimalField()
|
||||
self._test_validation_messages(f, 'fõo', ["'fõo' value must be a decimal number."])
|
||||
self._test_validation_messages(f, 'fõo', ['“fõo” value must be a decimal number.'])
|
||||
|
||||
def test_null_boolean_field_raises_error_message(self):
|
||||
f = models.NullBooleanField()
|
||||
self._test_validation_messages(f, 'fõo', ["'fõo' value must be either None, True or False."])
|
||||
self._test_validation_messages(f, 'fõo', ['“fõo” value must be either None, True or False.'])
|
||||
|
||||
def test_date_field_raises_error_message(self):
|
||||
f = models.DateField()
|
||||
self._test_validation_messages(
|
||||
f, 'fõo',
|
||||
["'fõo' value has an invalid date format. It must be in YYYY-MM-DD format."]
|
||||
['“fõo” value has an invalid date format. It must be in YYYY-MM-DD format.']
|
||||
)
|
||||
self._test_validation_messages(
|
||||
f, 'aaaa-10-10',
|
||||
["'aaaa-10-10' value has an invalid date format. It must be in YYYY-MM-DD format."]
|
||||
['“aaaa-10-10” value has an invalid date format. It must be in YYYY-MM-DD format.']
|
||||
)
|
||||
self._test_validation_messages(
|
||||
f, '2011-13-10',
|
||||
["'2011-13-10' value has the correct format (YYYY-MM-DD) but it is an invalid date."]
|
||||
['“2011-13-10” value has the correct format (YYYY-MM-DD) but it is an invalid date.']
|
||||
)
|
||||
self._test_validation_messages(
|
||||
f, '2011-10-32',
|
||||
["'2011-10-32' value has the correct format (YYYY-MM-DD) but it is an invalid date."]
|
||||
['“2011-10-32” value has the correct format (YYYY-MM-DD) but it is an invalid date.']
|
||||
)
|
||||
|
||||
def test_datetime_field_raises_error_message(self):
|
||||
|
@ -63,18 +63,18 @@ class ValidationMessagesTest(TestCase):
|
|||
# Wrong format
|
||||
self._test_validation_messages(
|
||||
f, 'fõo',
|
||||
["'fõo' value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format."]
|
||||
['“fõo” value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format.']
|
||||
)
|
||||
# Correct format but invalid date
|
||||
self._test_validation_messages(
|
||||
f, '2011-10-32',
|
||||
["'2011-10-32' value has the correct format (YYYY-MM-DD) but it is an invalid date."]
|
||||
['“2011-10-32” value has the correct format (YYYY-MM-DD) but it is an invalid date.']
|
||||
)
|
||||
# Correct format but invalid date/time
|
||||
self._test_validation_messages(
|
||||
f, '2011-10-32 10:10',
|
||||
["'2011-10-32 10:10' value has the correct format (YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ]) "
|
||||
"but it is an invalid date/time."]
|
||||
['“2011-10-32 10:10” value has the correct format (YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ]) '
|
||||
'but it is an invalid date/time.']
|
||||
)
|
||||
|
||||
def test_time_field_raises_error_message(self):
|
||||
|
@ -82,10 +82,10 @@ class ValidationMessagesTest(TestCase):
|
|||
# Wrong format
|
||||
self._test_validation_messages(
|
||||
f, 'fõo',
|
||||
["'fõo' value has an invalid format. It must be in HH:MM[:ss[.uuuuuu]] format."]
|
||||
['“fõo” value has an invalid format. It must be in HH:MM[:ss[.uuuuuu]] format.']
|
||||
)
|
||||
# Correct format but invalid time
|
||||
self._test_validation_messages(
|
||||
f, '25:50',
|
||||
["'25:50' value has the correct format (HH:MM[:ss[.uuuuuu]]) but it is an invalid time."]
|
||||
['“25:50” value has the correct format (HH:MM[:ss[.uuuuuu]]) but it is an invalid time.']
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue