Ticket #10204: patch_and_tests_final.diff
File patch_and_tests_final.diff, 2.2 KB (added by , 16 years ago) |
---|
-
django/contrib/localflavor/es/forms.py
75 75 self.nif_control = 'TRWAGMYFPDXBNJZSQVHLCKE' 76 76 self.cif_control = 'JABCDEFGHI' 77 77 self.cif_types = 'ABCDEFGHKLMNPQS' 78 self.nie_types = 'XT '78 self.nie_types = 'XTYZ' 79 79 id_card_re = re.compile(r'^([%s]?)[ -]?(\d+)[ -]?([%s]?)$' % (self.cif_types + self.nie_types, self.nif_control + self.cif_control), re.IGNORECASE) 80 80 super(ESIdentityCardNumberField, self).__init__(id_card_re, max_length=None, min_length=None, 81 81 error_message=self.default_error_messages['invalid%s' % (self.only_nif and '_only_nif' or '')], -
tests/regressiontests/forms/localflavor/es.py
155 155 'X0012953G' 156 156 >>> f.clean('x-3287690-r') 157 157 'X3287690R' 158 >>> f.clean('Y-3287690-R') 159 'Y3287690R' 160 >>> f.clean('y-3287690-r') 161 'Y3287690R' 162 >>> f.clean('Y 3287690 R') 163 'Y3287690R' 164 >>> f.clean('Y-3287690-T') 165 Traceback (most recent call last): 166 ... 167 ValidationError: [u'Invalid checksum for NIE.'] 168 >>> f.clean('Y-03287690') 169 Traceback (most recent call last): 170 ... 171 ValidationError: [u'Please enter a valid NIF, NIE, or CIF.'] 172 >>> f.clean('Z-3287690-R') 173 'Z3287690R' 174 >>> f.clean('Z-3287690-T') 175 Traceback (most recent call last): 176 ... 177 ValidationError: [u'Invalid checksum for NIE.'] 178 >>> f.clean('Z-03287690') 179 Traceback (most recent call last): 180 ... 181 ValidationError: [u'Please enter a valid NIF, NIE, or CIF.'] 158 182 >>> f.clean('t-03287690r') 159 183 'T03287690R' 160 184 >>> f.clean('P2907500I') -
AUTHORS
444 444 Mykola Zamkovoi <nickzam@gmail.com> 445 445 Jarek Zgoda <jarek.zgoda@gmail.com> 446 446 Cheng Zhang 447 Pablo Suárez Hernández <meaksh@gmail.com> 447 448 448 449 A big THANK YOU goes to: 449 450