diff --git a/django/contrib/localflavor/es/forms.py b/django/contrib/localflavor/es/forms.py index b61860d500..000f695630 100644 --- a/django/contrib/localflavor/es/forms.py +++ b/django/contrib/localflavor/es/forms.py @@ -41,7 +41,7 @@ class ESPhoneNumberField(RegexField): } def __init__(self, *args, **kwargs): - super(ESPhoneNumberField, self).__init__(r'^(6|8|9)\d{8}$', + super(ESPhoneNumberField, self).__init__(r'^(6|7|8|9)\d{8}$', max_length=None, min_length=None, *args, **kwargs) class ESIdentityCardNumberField(RegexField): diff --git a/tests/regressiontests/forms/localflavor/es.py b/tests/regressiontests/forms/localflavor/es.py index b584075513..95a94c4fa8 100644 --- a/tests/regressiontests/forms/localflavor/es.py +++ b/tests/regressiontests/forms/localflavor/es.py @@ -108,10 +108,11 @@ class ESLocalFlavorTests(LocalFlavorTestCase): '650010101': '650010101', '931234567': '931234567', '800123123': '800123123', + '789789789': '789789789', } invalid = { '555555555': error_invalid, - '789789789': error_invalid, + '489489489': error_invalid, '99123123': error_invalid, '9999123123': error_invalid, }