Fixed #15640 -- Added new initial digit in Spain phone numbers to localflavor's ESPhoneNumberField form field. Thanks, Claude Paroz.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16132 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel 2011-04-30 13:40:05 +00:00
parent 13b4f98b80
commit c78d861c24
2 changed files with 3 additions and 2 deletions

View File

@ -41,7 +41,7 @@ class ESPhoneNumberField(RegexField):
} }
def __init__(self, *args, **kwargs): 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) max_length=None, min_length=None, *args, **kwargs)
class ESIdentityCardNumberField(RegexField): class ESIdentityCardNumberField(RegexField):

View File

@ -108,10 +108,11 @@ class ESLocalFlavorTests(LocalFlavorTestCase):
'650010101': '650010101', '650010101': '650010101',
'931234567': '931234567', '931234567': '931234567',
'800123123': '800123123', '800123123': '800123123',
'789789789': '789789789',
} }
invalid = { invalid = {
'555555555': error_invalid, '555555555': error_invalid,
'789789789': error_invalid, '489489489': error_invalid,
'99123123': error_invalid, '99123123': error_invalid,
'9999123123': error_invalid, '9999123123': error_invalid,
} }