diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-04-10 01:13:29 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-04-10 01:13:29 +0000 |
| commit | 6c45765681b71e91633d4447eeb4088c4989dde5 (patch) | |
| tree | 50775a8037d906dfcaa2700c8785ff235993685d /tests/regressiontests/forms | |
| parent | 8c3d593b0f6d8c3a60eb6f95a687ec42a77340c4 (diff) | |
[1.0.X] Fixed #8515 -- Fixed validation of Polish REGON numbers.
Patch from Piotr Lewandowski.
Backport of r10460 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10461 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/forms')
| -rw-r--r-- | tests/regressiontests/forms/localflavor/pl.py | 12 |
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.'] """ |
