diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-04-10 01:03:44 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-04-10 01:03:44 +0000 |
| commit | f6309cbf8058b77729f9ba96c26accdbb7ae5596 (patch) | |
| tree | 2307addbd4d6ae0324ec1b979e76d38448bbb1de /tests/regressiontests/forms | |
| parent | e5be4b4f3deae24f8e189dfa46dc15397441d562 (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.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.'] """ |
