diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-10-20 09:24:19 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-10-20 09:24:19 +0000 |
| commit | 8db11840d3ded74275af0a76855d05ece5e6641a (patch) | |
| tree | fd40b47f673443d197e52b3d182fa80aa1d73b65 /tests | |
| parent | aac5555f2fb333d958e838274fd18cf3ac89d914 (diff) | |
Fixed #5200 -- Added some more functionality to the Polish localflavor. Thanks,
Slawek Mikula.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6556 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/forms/localflavor/pl.py | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/tests/regressiontests/forms/localflavor/pl.py b/tests/regressiontests/forms/localflavor/pl.py index be8437208b..becdda8a1d 100644 --- a/tests/regressiontests/forms/localflavor/pl.py +++ b/tests/regressiontests/forms/localflavor/pl.py @@ -35,11 +35,15 @@ u'41-403' Traceback (most recent call last): ... ValidationError: [u'Enter a tax number field (NIP) in the format XXX-XXX-XX-XX or XX-XX-XXX-XXX.'] ->>> f.clean('43-34-234-323') -u'43-34-234-323' ->>> f.clean('433-344-24-23') -u'433-344-24-23' - +>>> f.clean('64-62-414-124') +u'6462414124' +>>> f.clean('646-241-41-24') +u'6462414124' +>>> f.clean('646-241-41-23') +Traceback (most recent call last): +... +ValidationError: [u'Wrong checksum for the Tax Number (NIP).'] + # PLNationalIdentificationNumberField ############################################ >>> from django.contrib.localflavor.pl.forms import PLNationalIdentificationNumberField @@ -58,4 +62,20 @@ ValidationError: [u'National Identification Number consists of 11 digits.'] Traceback (most recent call last): ... ValidationError: [u'National Identification Number consists of 11 digits.'] + +# PLNationalBusinessRegisterField ################################################ + +>>> from django.contrib.localflavor.pl.forms import PLNationalBusinessRegisterField +>>> f = PLNationalBusinessRegisterField() +>>> f.clean('590096454') +u'590096454' +>>> f.clean('590096453') +Traceback (most recent call last): +... +ValidationError: [u'Wrong checksum for the National Business Register Number (REGON).'] +>>> f.clean('590096') +Traceback (most recent call last): +... +ValidationError: [u'National Business Register Number (REGON) consists of 7 or 9 digits.'] + """ |
