Changeset 6985
- Timestamp:
- 01/01/08 23:23:21 (8 months ago)
- Files:
-
- django/trunk/django/contrib/localflavor/ca/forms.py (modified) (1 diff)
- django/trunk/docs/localflavor.txt (modified) (1 diff)
- django/trunk/tests/regressiontests/forms/localflavor/ca.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/contrib/localflavor/ca/forms.py
r6926 r6985 81 81 Checks the following rules to determine whether the number is valid: 82 82 83 * Conforms to the XXX-XXX-XXX Xformat.83 * Conforms to the XXX-XXX-XXX format. 84 84 * Passes the check digit process "Luhn Algorithm" 85 85 See: http://en.wikipedia.org/wiki/Social_Insurance_Number 86 86 """ 87 87 default_error_messages = { 88 'invalid': ugettext('Enter a valid Canadian Social Insurance number in XXX-XXX-XXX Xformat.'),88 'invalid': ugettext('Enter a valid Canadian Social Insurance number in XXX-XXX-XXX format.'), 89 89 } 90 90 django/trunk/docs/localflavor.txt
r6946 r6985 182 182 183 183 A form field that validates input as a Canadian Social Insurance Number (SIN). 184 A valid number must have the format XXX-XXX-XXX Xand pass a `Luhn mod-10184 A valid number must have the format XXX-XXX-XXX and pass a `Luhn mod-10 185 185 checksum`_. 186 186 django/trunk/tests/regressiontests/forms/localflavor/ca.py
r6744 r6985 214 214 Traceback (most recent call last): 215 215 ... 216 ValidationError: [u'Enter a valid Canadian Social Insurance number in XXX-XXX-XXX Xformat.']216 ValidationError: [u'Enter a valid Canadian Social Insurance number in XXX-XXX-XXX format.'] 217 217 >>> f.clean('046 454 286') 218 218 Traceback (most recent call last): 219 219 ... 220 ValidationError: [u'Enter a valid Canadian Social Insurance number in XXX-XXX-XXX Xformat.']220 ValidationError: [u'Enter a valid Canadian Social Insurance number in XXX-XXX-XXX format.'] 221 221 >>> f.clean('046-44-286') 222 222 Traceback (most recent call last): 223 223 ... 224 ValidationError: [u'Enter a valid Canadian Social Insurance number in XXX-XXX-XXX Xformat.']224 ValidationError: [u'Enter a valid Canadian Social Insurance number in XXX-XXX-XXX format.'] 225 225 """
