summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-04-10 01:03:44 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-04-10 01:03:44 +0000
commitf6309cbf8058b77729f9ba96c26accdbb7ae5596 (patch)
tree2307addbd4d6ae0324ec1b979e76d38448bbb1de /tests/regressiontests/forms
parente5be4b4f3deae24f8e189dfa46dc15397441d562 (diff)
Fixed #8515 -- Fixed validation of Polish REGON numbers.
Patch from Piotr Lewandowski. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10460 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/forms')
-rw-r--r--tests/regressiontests/forms/localflavor/pl.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/regressiontests/forms/localflavor/pl.py b/tests/regressiontests/forms/localflavor/pl.py
index ce6ccda81a..52f1305ca8 100644
--- a/tests/regressiontests/forms/localflavor/pl.py
+++ b/tests/regressiontests/forms/localflavor/pl.py
@@ -67,8 +67,18 @@ ValidationError: [u'National Identification Number consists of 11 digits.']
>>> from django.contrib.localflavor.pl.forms import PLREGONField
>>> f = PLREGONField()
+>>> f.clean('12345678512347')
+u'12345678512347'
>>> f.clean('590096454')
u'590096454'
+>>> f.clean('123456784')
+Traceback (most recent call last):
+...
+ValidationError: [u'Wrong checksum for the National Business Register Number (REGON).']
+>>> f.clean('12345678412342')
+Traceback (most recent call last):
+...
+ValidationError: [u'Wrong checksum for the National Business Register Number (REGON).']
>>> f.clean('590096453')
Traceback (most recent call last):
...
@@ -76,6 +86,6 @@ ValidationError: [u'Wrong checksum for the National Business Register Number (RE
>>> f.clean('590096')
Traceback (most recent call last):
...
-ValidationError: [u'National Business Register Number (REGON) consists of 7 or 9 digits.']
+ValidationError: [u'National Business Register Number (REGON) consists of 9 or 14 digits.']
"""