diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/forms/error_messages.py | 12 | ||||
| -rw-r--r-- | tests/regressiontests/forms/fields.py | 2 | ||||
| -rw-r--r-- | tests/regressiontests/forms/localflavor/ar.py | 8 | ||||
| -rw-r--r-- | tests/regressiontests/forms/localflavor/is_.py | 10 |
4 files changed, 16 insertions, 16 deletions
diff --git a/tests/regressiontests/forms/error_messages.py b/tests/regressiontests/forms/error_messages.py index 12ec8a1585..038fa39f6b 100644 --- a/tests/regressiontests/forms/error_messages.py +++ b/tests/regressiontests/forms/error_messages.py @@ -6,8 +6,8 @@ tests = r""" # CharField ################################################################### >>> e = {'required': 'REQUIRED'} ->>> e['min_length'] = 'LENGTH %(length)s, MIN LENGTH %(min)s' ->>> e['max_length'] = 'LENGTH %(length)s, MAX LENGTH %(max)s' +>>> e['min_length'] = 'LENGTH %(show_value)s, MIN LENGTH %(limit_value)s' +>>> e['max_length'] = 'LENGTH %(show_value)s, MAX LENGTH %(limit_value)s' >>> f = CharField(min_length=5, max_length=10, error_messages=e) >>> f.clean('') Traceback (most recent call last): @@ -156,8 +156,8 @@ ValidationError: [u'INVALID'] >>> e = {'required': 'REQUIRED'} >>> e['invalid'] = 'INVALID' ->>> e['min_length'] = 'LENGTH %(length)s, MIN LENGTH %(min)s' ->>> e['max_length'] = 'LENGTH %(length)s, MAX LENGTH %(max)s' +>>> e['min_length'] = 'LENGTH %(show_value)s, MIN LENGTH %(limit_value)s' +>>> e['max_length'] = 'LENGTH %(show_value)s, MAX LENGTH %(limit_value)s' >>> f = RegexField(r'^\d+$', min_length=5, max_length=10, error_messages=e) >>> f.clean('') Traceback (most recent call last): @@ -180,8 +180,8 @@ ValidationError: [u'LENGTH 11, MAX LENGTH 10'] >>> e = {'required': 'REQUIRED'} >>> e['invalid'] = 'INVALID' ->>> e['min_length'] = 'LENGTH %(length)s, MIN LENGTH %(min)s' ->>> e['max_length'] = 'LENGTH %(length)s, MAX LENGTH %(max)s' +>>> e['min_length'] = 'LENGTH %(show_value)s, MIN LENGTH %(limit_value)s' +>>> e['max_length'] = 'LENGTH %(show_value)s, MAX LENGTH %(limit_value)s' >>> f = EmailField(min_length=8, max_length=10, error_messages=e) >>> f.clean('') Traceback (most recent call last): diff --git a/tests/regressiontests/forms/fields.py b/tests/regressiontests/forms/fields.py index 1b96450f63..b413d88d80 100644 --- a/tests/regressiontests/forms/fields.py +++ b/tests/regressiontests/forms/fields.py @@ -386,7 +386,7 @@ class FieldsTests(TestCase): def test_regexfield_31(self): f = RegexField('^\d+$', min_length=5, max_length=10) self.assertRaisesErrorWithMessage(ValidationError, "[u'Ensure this value has at least 5 characters (it has 3).']", f.clean, '123') - self.assertRaisesErrorWithMessage(ValidationError, "[u'Ensure this value has at least 5 characters (it has 3).']", f.clean, 'abc') + self.assertRaisesErrorWithMessage(ValidationError, "[u'Ensure this value has at least 5 characters (it has 3).', u'Enter a valid value.']", f.clean, 'abc') self.assertEqual(u'12345', f.clean('12345')) self.assertEqual(u'1234567890', f.clean('1234567890')) self.assertRaisesErrorWithMessage(ValidationError, "[u'Ensure this value has at most 10 characters (it has 11).']", f.clean, '12345678901') diff --git a/tests/regressiontests/forms/localflavor/ar.py b/tests/regressiontests/forms/localflavor/ar.py index e1c827c4a0..c7967c84da 100644 --- a/tests/regressiontests/forms/localflavor/ar.py +++ b/tests/regressiontests/forms/localflavor/ar.py @@ -28,7 +28,7 @@ u'C1064AAB' >>> f.clean('C1064AABB') Traceback (most recent call last): ... -ValidationError: [u'Ensure this value has at most 8 characters (it has 9).'] +ValidationError: [u'Ensure this value has at most 8 characters (it has 9).', u'Enter a postal code in the format NNNN or ANNNNAAA.'] >>> f.clean('C1064AA') Traceback (most recent call last): ... @@ -44,7 +44,7 @@ ValidationError: [u'Enter a postal code in the format NNNN or ANNNNAAA.'] >>> f.clean('500') Traceback (most recent call last): ... -ValidationError: [u'Ensure this value has at least 4 characters (it has 3).'] +ValidationError: [u'Ensure this value has at least 4 characters (it has 3).', u'Enter a postal code in the format NNNN or ANNNNAAA.'] >>> f.clean('5PPP') Traceback (most recent call last): ... @@ -78,7 +78,7 @@ u'C1064AAB' >>> f.clean('C1064AABB') Traceback (most recent call last): ... -ValidationError: [u'Ensure this value has at most 8 characters (it has 9).'] +ValidationError: [u'Ensure this value has at most 8 characters (it has 9).', u'Enter a postal code in the format NNNN or ANNNNAAA.'] >>> f.clean('C1064AA') Traceback (most recent call last): ... @@ -94,7 +94,7 @@ ValidationError: [u'Enter a postal code in the format NNNN or ANNNNAAA.'] >>> f.clean('500') Traceback (most recent call last): ... -ValidationError: [u'Ensure this value has at least 4 characters (it has 3).'] +ValidationError: [u'Ensure this value has at least 4 characters (it has 3).', u'Enter a postal code in the format NNNN or ANNNNAAA.'] >>> f.clean('5PPP') Traceback (most recent call last): ... diff --git a/tests/regressiontests/forms/localflavor/is_.py b/tests/regressiontests/forms/localflavor/is_.py index 6851441a79..e71c2dd8de 100644 --- a/tests/regressiontests/forms/localflavor/is_.py +++ b/tests/regressiontests/forms/localflavor/is_.py @@ -15,11 +15,11 @@ u'230880-3449' >>> f.clean('230880343') Traceback (most recent call last): ... -ValidationError: [u'Ensure this value has at least 10 characters (it has 9).'] +ValidationError: [u'Ensure this value has at least 10 characters (it has 9).', u'Enter a valid Icelandic identification number. The format is XXXXXX-XXXX.'] >>> f.clean('230880343234') Traceback (most recent call last): ... -ValidationError: [u'Ensure this value has at most 11 characters (it has 12).'] +ValidationError: [u'Ensure this value has at most 11 characters (it has 12).', u'Enter a valid Icelandic identification number. The format is XXXXXX-XXXX.'] >>> f.clean('abcdefghijk') Traceback (most recent call last): ... @@ -61,18 +61,18 @@ ValidationError: [u'Enter a valid value.'] >>> f.clean('123456') Traceback (most recent call last): ... -ValidationError: [u'Ensure this value has at least 7 characters (it has 6).'] +ValidationError: [u'Ensure this value has at least 7 characters (it has 6).', u'Enter a valid value.'] >>> f.clean('123456555') Traceback (most recent call last): ... -ValidationError: [u'Ensure this value has at most 8 characters (it has 9).'] +ValidationError: [u'Ensure this value has at most 8 characters (it has 9).', u'Enter a valid value.'] >>> f.clean('abcdefg') Traceback (most recent call last): ValidationError: [u'Enter a valid value.'] >>> f.clean(' 1234567 ') Traceback (most recent call last): ... -ValidationError: [u'Ensure this value has at most 8 characters (it has 9).'] +ValidationError: [u'Ensure this value has at most 8 characters (it has 9).', u'Enter a valid value.'] >>> f.clean(' 12367 ') Traceback (most recent call last): ... |
