Skip to content

Commit

Permalink
remove form field in RegisterForm and change relative test
Browse files Browse the repository at this point in the history
  • Loading branch information
laura-barluzzi committed Jul 24, 2017
1 parent 000c50a commit 04b8331
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions cadasta/accounts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ class RegisterForm(SanitizeFieldsForm, forms.ModelForm):
email = forms.EmailField(required=True)
password = forms.CharField(widget=forms.PasswordInput())
MIN_LENGTH = 10
language = forms.ChoiceField(
required=False,
choices=settings.LANGUAGES,
error_messages={
'invalid_choice': _('Language invalid or not available')
}
)

class Meta:
model = User
Expand Down
4 changes: 2 additions & 2 deletions cadasta/accounts/tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ def test_signup_with_invalid_language(self):
form = forms.RegisterForm(data)
assert form.is_valid() is False
assert User.objects.count() == 0
assert ('Language invalid or not available'
in form.errors.get('language'))
assert ('Select a valid choice. invalid is not one of the '
'available choices.' in form.errors.get('language'))

def test_sanitize(self):
data = {
Expand Down

0 comments on commit 04b8331

Please sign in to comment.