1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

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
This commit is contained in:
Malcolm Tredinnick
2009-04-10 01:03:44 +00:00
parent e5be4b4f3d
commit f6309cbf80
2 changed files with 27 additions and 24 deletions

View File

@@ -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.']
"""