summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2009-12-13 17:05:17 +0000
committerKaren Tracey <kmtracey@gmail.com>2009-12-13 17:05:17 +0000
commit64736fe37f366519b52d236d1432c7b1fd831b02 (patch)
tree9e82dfafb6b4a50ac595ffc5ae96a69e7d0dcf06 /tests/regressiontests/forms
parentb5ffd10547e941a8514eae23bc1dc1ee908d2ff2 (diff)
[1.1.X] Fixed #12146: Corrected Canadian postal code validation. Thanks paulschreiber and Mark Lavin.
r11844 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@11845 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/forms')
-rw-r--r--tests/regressiontests/forms/localflavor/ca.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/localflavor/ca.py b/tests/regressiontests/forms/localflavor/ca.py
index 48171b0558..7f4b3ac89c 100644
--- a/tests/regressiontests/forms/localflavor/ca.py
+++ b/tests/regressiontests/forms/localflavor/ca.py
@@ -60,6 +60,50 @@ ValidationError: [u'Enter a postal code in the format XXX XXX.']
u''
>>> f.clean('')
u''
+>>> f.clean('W2S 2H3')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a postal code in the format XXX XXX.']
+>>> f.clean('T2W 2H7')
+u'T2W 2H7'
+>>> f.clean('T2S 2W7')
+u'T2S 2W7'
+>>> f.clean('Z2S 2H3')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a postal code in the format XXX XXX.']
+>>> f.clean('T2Z 2H7')
+u'T2Z 2H7'
+>>> f.clean('T2S 2Z7')
+u'T2S 2Z7'
+>>> f.clean('F2S 2H3')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a postal code in the format XXX XXX.']
+>>> f.clean('A2S 2D3')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a postal code in the format XXX XXX.']
+>>> f.clean('A2I 2R3')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a postal code in the format XXX XXX.']
+>>> f.clean('A2I 2R3')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a postal code in the format XXX XXX.']
+>>> f.clean('A2Q 2R3')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a postal code in the format XXX XXX.']
+>>> f.clean('U2B 2R3')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a postal code in the format XXX XXX.']
+>>> f.clean('O2B 2R3')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a postal code in the format XXX XXX.']
# CAPhoneNumberField ##########################################################