From f6336737a014b665b4c62bc89b01b7658824517c Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Wed, 2 Jan 2008 05:23:21 +0000 Subject: [PATCH] Fixed #6291 -- Fixed error in CASocialInsuranceNumberField documentation and error message. Thanks, jeff+django@ivany.org and arien git-svn-id: http://code.djangoproject.com/svn/django/trunk@6985 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/localflavor/ca/forms.py | 4 ++-- docs/localflavor.txt | 2 +- tests/regressiontests/forms/localflavor/ca.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/django/contrib/localflavor/ca/forms.py b/django/contrib/localflavor/ca/forms.py index daeff58acf..b40dba8335 100644 --- a/django/contrib/localflavor/ca/forms.py +++ b/django/contrib/localflavor/ca/forms.py @@ -80,12 +80,12 @@ class CASocialInsuranceNumberField(Field): Checks the following rules to determine whether the number is valid: - * Conforms to the XXX-XXX-XXXX format. + * Conforms to the XXX-XXX-XXX format. * Passes the check digit process "Luhn Algorithm" See: http://en.wikipedia.org/wiki/Social_Insurance_Number """ default_error_messages = { - 'invalid': ugettext('Enter a valid Canadian Social Insurance number in XXX-XXX-XXXX format.'), + 'invalid': ugettext('Enter a valid Canadian Social Insurance number in XXX-XXX-XXX format.'), } def clean(self, value): diff --git a/docs/localflavor.txt b/docs/localflavor.txt index 154922ff45..fc227fee28 100644 --- a/docs/localflavor.txt +++ b/docs/localflavor.txt @@ -181,7 +181,7 @@ CASocialInsuranceNumberField ---------------------------- A form field that validates input as a Canadian Social Insurance Number (SIN). -A valid number must have the format XXX-XXX-XXXX and pass a `Luhn mod-10 +A valid number must have the format XXX-XXX-XXX and pass a `Luhn mod-10 checksum`_. .. _Luhn mod-10 checksum: http://en.wikipedia.org/wiki/Luhn_algorithm diff --git a/tests/regressiontests/forms/localflavor/ca.py b/tests/regressiontests/forms/localflavor/ca.py index a13a6de65f..48171b0558 100644 --- a/tests/regressiontests/forms/localflavor/ca.py +++ b/tests/regressiontests/forms/localflavor/ca.py @@ -213,13 +213,13 @@ u'046-454-286' >>> f.clean('046-454-287') Traceback (most recent call last): ... -ValidationError: [u'Enter a valid Canadian Social Insurance number in XXX-XXX-XXXX format.'] +ValidationError: [u'Enter a valid Canadian Social Insurance number in XXX-XXX-XXX format.'] >>> f.clean('046 454 286') Traceback (most recent call last): ... -ValidationError: [u'Enter a valid Canadian Social Insurance number in XXX-XXX-XXXX format.'] +ValidationError: [u'Enter a valid Canadian Social Insurance number in XXX-XXX-XXX format.'] >>> f.clean('046-44-286') Traceback (most recent call last): ... -ValidationError: [u'Enter a valid Canadian Social Insurance number in XXX-XXX-XXXX format.'] +ValidationError: [u'Enter a valid Canadian Social Insurance number in XXX-XXX-XXX format.'] """