# -*- coding: utf-8 -*-
# Tests for the contrib/localflavor/ PL form fields.
tests = r"""
# PLProvinceSelect ##########################################################
>>> from django.contrib.localflavor.pl.forms import PLProvinceSelect
>>> f = PLProvinceSelect()
>>> f.render('voivodeships','pomerania')
u''
# PLCountiesSelect ##########################################################
>>> from django.contrib.localflavor.pl.forms import PLCountiesSelect
>>> f = PLCountiesSelect()
>>> f.render('administrativeunit','katowice')
u''
# PLPostalCodeField ##############################################################
>>> from django.contrib.localflavor.pl.forms import PLPostalCodeField
>>> f = PLPostalCodeField()
>>> f.clean('43--434')
Traceback (most recent call last):
...
ValidationError: [u'Enter a postal code in the format XX-XXX.']
>>> f.clean('41-403')
u'41-403'
# PLNIPField ###############################################################
>>> from django.contrib.localflavor.pl.forms import PLNIPField
>>> f = PLNIPField()
>>> f.clean('43-343-234-323')
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('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).']
# PLPESELField ############################################
>>> from django.contrib.localflavor.pl.forms import PLPESELField
>>> f = PLPESELField()
>>> f.clean('80071610614')
u'80071610614'
>>> f.clean('80071610610')
Traceback (most recent call last):
...
ValidationError: [u'Wrong checksum for the National Identification Number.']
>>> f.clean('80')
Traceback (most recent call last):
...
ValidationError: [u'National Identification Number consists of 11 digits.']
>>> f.clean('800716106AA')
Traceback (most recent call last):
...
ValidationError: [u'National Identification Number consists of 11 digits.']
# PLREGONField ################################################
>>> from django.contrib.localflavor.pl.forms import PLREGONField
>>> f = PLREGONField()
>>> 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.']
"""