1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Added supplementary check for CUIT number of ar localflavor

Thanks Kevin Schaul for the initial patch.
This commit is contained in:
Claude Paroz
2012-07-09 14:07:01 +02:00
parent 1d2982362d
commit d9db1d3373
2 changed files with 8 additions and 3 deletions

View File

@@ -81,6 +81,7 @@ class ARLocalFlavorTests(SimpleTestCase):
def test_ARCUITField(self):
error_format = ['Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXXXXX format.']
error_invalid = ['Invalid CUIT.']
error_legal_type = [u'Invalid legal type. Type must be 27, 20, 23 or 30.']
valid = {
'20-10123456-9': '20-10123456-9',
'20-10123456-9': '20-10123456-9',
@@ -94,8 +95,9 @@ class ARLocalFlavorTests(SimpleTestCase):
'210123456-9': error_format,
'20-10123456': error_format,
'20-10123456-': error_format,
'20-10123456-5': error_invalid,
'27-10345678-1': error_invalid,
'27-10345678-1': error_invalid,
'20-10123456-5': error_invalid,
'27-10345678-1': error_invalid,
'27-10345678-1': error_invalid,
'11211111110': error_legal_type,
}
self.assertFieldOutput(ARCUITField, valid, invalid)