Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Italian Tax code error message #167

Merged
merged 1 commit into from
Aug 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions localflavor/it/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ def __init__(self, attrs=None):

class ITSocialSecurityNumberField(RegexField):
"""
A form field that validates Italian Social Security numbers (codice fiscale) for
both persons and entities.
A form field that validates Italian Tax code (codice fiscale) for both persons and entities.

For reference see http://www.agenziaentrate.it/ and search for:

Expand All @@ -74,7 +73,7 @@ class ITSocialSecurityNumberField(RegexField):
entities (numeric-only form).
"""
default_error_messages = {
'invalid': _('Enter a valid Social Security number.'),
'invalid': _('Enter a valid Tax code.'),
}

def __init__(self, max_length=None, min_length=None, *args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion localflavor/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -5779,7 +5779,7 @@ msgid "Enter a valid zip code."
msgstr ""

#: it/forms.py:77
msgid "Enter a valid Social Security number."
msgid "Enter a valid Tax code."
msgstr ""

#: it/forms.py:109
Expand Down
4 changes: 2 additions & 2 deletions tests/test_it.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def test_ITZipCodeField(self):
self.assertFieldOutput(ITZipCodeField, valid, invalid)

def test_ITSocialSecurityNumberField(self):
error_invalid = ['Enter a valid Social Security number.']
error_invalid = ['Enter a valid Tax code.']
valid = {
'LVSGDU99T71H501L': 'LVSGDU99T71H501L',
'LBRRME11A01L736W': 'LBRRME11A01L736W',
Expand All @@ -221,7 +221,7 @@ def test_ITSocialSecurityNumberField(self):
self.assertFieldOutput(ITSocialSecurityNumberField, valid, invalid)

def test_ITSocialSecurityNumberField_for_entities(self):
error_invalid = ['Enter a valid Social Security number.']
error_invalid = ['Enter a valid Tax code.']
valid = {
'07973780013': '07973780013',
'7973780013': '07973780013',
Expand Down