summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regressiontests/forms')
-rw-r--r--tests/regressiontests/forms/localflavor/ca.py6
-rw-r--r--tests/regressiontests/forms/localflavor/cl.py8
-rw-r--r--tests/regressiontests/forms/localflavor/uk.py29
3 files changed, 28 insertions, 15 deletions
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.']
"""
diff --git a/tests/regressiontests/forms/localflavor/cl.py b/tests/regressiontests/forms/localflavor/cl.py
index 407f6610e4..23e7a41902 100644
--- a/tests/regressiontests/forms/localflavor/cl.py
+++ b/tests/regressiontests/forms/localflavor/cl.py
@@ -41,7 +41,7 @@ Strict RUT usage (does not allow imposible values)
>>> rut.clean('11-6')
Traceback (most recent call last):
...
-ValidationError: [u'Enter valid a Chilean RUT. The format is XX.XXX.XXX-X.']
+ValidationError: [u'Enter a valid Chilean RUT. The format is XX.XXX.XXX-X.']
# valid format, bad verifier.
>>> rut.clean('11.111.111-0')
@@ -53,17 +53,17 @@ ValidationError: [u'The Chilean RUT is not valid.']
>>> rut.clean('767484100')
Traceback (most recent call last):
...
-ValidationError: [u'Enter valid a Chilean RUT. The format is XX.XXX.XXX-X.']
+ValidationError: [u'Enter a valid Chilean RUT. The format is XX.XXX.XXX-X.']
>>> rut.clean('78.412.790-7')
u'78.412.790-7'
>>> rut.clean('8.334.6043')
Traceback (most recent call last):
...
-ValidationError: [u'Enter valid a Chilean RUT. The format is XX.XXX.XXX-X.']
+ValidationError: [u'Enter a valid Chilean RUT. The format is XX.XXX.XXX-X.']
>>> rut.clean('76793310-K')
Traceback (most recent call last):
...
-ValidationError: [u'Enter valid a Chilean RUT. The format is XX.XXX.XXX-X.']
+ValidationError: [u'Enter a valid Chilean RUT. The format is XX.XXX.XXX-X.']
## CLRegionSelect #########################################################
>>> from django.contrib.localflavor.cl.forms import CLRegionSelect
diff --git a/tests/regressiontests/forms/localflavor/uk.py b/tests/regressiontests/forms/localflavor/uk.py
index d7848f70a8..258c22e5a9 100644
--- a/tests/regressiontests/forms/localflavor/uk.py
+++ b/tests/regressiontests/forms/localflavor/uk.py
@@ -12,13 +12,15 @@ u'BT32 4PX'
>>> f.clean('GIR 0AA')
u'GIR 0AA'
>>> f.clean('BT324PX')
+u'BT32 4PX'
+>>> f.clean('1NV 4L1D')
Traceback (most recent call last):
...
-ValidationError: [u'Enter a postcode. A space is required between the two postcode parts.']
->>> f.clean('1NV 4L1D')
+ValidationError: [u'Enter a valid postcode.']
+>>> f.clean('1NV4L1D')
Traceback (most recent call last):
...
-ValidationError: [u'Enter a postcode. A space is required between the two postcode parts.']
+ValidationError: [u'Enter a valid postcode.']
>>> f.clean(None)
Traceback (most recent call last):
...
@@ -27,7 +29,20 @@ ValidationError: [u'This field is required.']
Traceback (most recent call last):
...
ValidationError: [u'This field is required.']
-
+>>> f.clean(' so11aa ')
+u'SO1 1AA'
+>>> f.clean(' so1 1aa ')
+u'SO1 1AA'
+>>> f.clean('G2 3wt')
+u'G2 3WT'
+>>> f.clean('EC1A 1BB')
+u'EC1A 1BB'
+>>> f.clean('Ec1a1BB')
+u'EC1A 1BB'
+>>> f.clean(' b0gUS')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid postcode.']
>>> f = UKPostcodeField(required=False)
>>> f.clean('BT32 4PX')
u'BT32 4PX'
@@ -36,11 +51,9 @@ u'GIR 0AA'
>>> f.clean('1NV 4L1D')
Traceback (most recent call last):
...
-ValidationError: [u'Enter a postcode. A space is required between the two postcode parts.']
+ValidationError: [u'Enter a valid postcode.']
>>> f.clean('BT324PX')
-Traceback (most recent call last):
-...
-ValidationError: [u'Enter a postcode. A space is required between the two postcode parts.']
+u'BT32 4PX'
>>> f.clean(None)
u''
>>> f.clean('')