Ticket #15640: 15640.diff

File 15640.diff, 1.3 KB (added by Claude Paroz, 13 years ago)

Patch with tests

  • django/contrib/localflavor/es/forms.py

    diff --git a/django/contrib/localflavor/es/forms.py b/django/contrib/localflavor/es/forms.py
    index b61860d..000f695 100644
    a b class ESPhoneNumberField(RegexField):  
    4141    }
    4242
    4343    def __init__(self, *args, **kwargs):
    44         super(ESPhoneNumberField, self).__init__(r'^(6|8|9)\d{8}$',
     44        super(ESPhoneNumberField, self).__init__(r'^(6|7|8|9)\d{8}$',
    4545                max_length=None, min_length=None, *args, **kwargs)
    4646
    4747class ESIdentityCardNumberField(RegexField):
  • tests/regressiontests/forms/localflavor/es.py

    diff --git a/tests/regressiontests/forms/localflavor/es.py b/tests/regressiontests/forms/localflavor/es.py
    index b584075..95a94c4 100644
    a b class ESLocalFlavorTests(LocalFlavorTestCase):  
    108108            '650010101': '650010101',
    109109            '931234567': '931234567',
    110110            '800123123': '800123123',
     111            '789789789': '789789789',
    111112        }
    112113        invalid = {
    113114            '555555555': error_invalid,
    114             '789789789': error_invalid,
     115            '489489489': error_invalid,
    115116            '99123123': error_invalid,
    116117            '9999123123': error_invalid,
    117118        }
Back to Top