-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove form fiels in ProfileForm and all tests not required
- Loading branch information
1 parent
04b8331
commit d36378d
Showing
2 changed files
with
0 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,20 +209,6 @@ def test_signup_with_restricted_username(self): | |
in form.errors.get('username')) | ||
assert User.objects.count() == 0 | ||
|
||
def test_signup_with_invalid_language(self): | ||
data = { | ||
'username': 'imagine71', | ||
'email': '[email protected]', | ||
'password': 'iloveyoko79!', | ||
'full_name': 'John Lennon', | ||
'language': 'invalid', | ||
} | ||
form = forms.RegisterForm(data) | ||
assert form.is_valid() is False | ||
assert User.objects.count() == 0 | ||
assert ('Select a valid choice. invalid is not one of the ' | ||
'available choices.' in form.errors.get('language')) | ||
|
||
def test_sanitize(self): | ||
data = { | ||
'username': '😛😛😛😛', | ||
|
@@ -430,40 +416,6 @@ def test_update_email_with_incorrect_password(self): | |
assert ("Please provide the correct password for your account." in | ||
form.errors['password']) | ||
|
||
def test_update_with_invalid_language(self): | ||
user = UserFactory.create(email='[email protected]', | ||
password='imagine71', | ||
language='en') | ||
data = { | ||
'username': 'imagine71', | ||
'email': '[email protected]', | ||
'full_name': 'John Lennon', | ||
'password': 'stg-pepper', | ||
'language': 'invalid' | ||
} | ||
form = forms.ProfileForm(data, instance=user) | ||
assert form.is_valid() is False | ||
assert user.language == 'en' | ||
assert ('Language invalid or not available' | ||
in form.errors.get('language')) | ||
|
||
def test_update_user_with_invalid_measurement(self): | ||
user = UserFactory.create(email='[email protected]', | ||
password='imagine71', | ||
measurement='metric') | ||
data = { | ||
'username': 'imagine71', | ||
'email': '[email protected]', | ||
'full_name': 'John Lennon', | ||
'password': 'stg-pepper', | ||
'measurement': 'invalid' | ||
} | ||
form = forms.ProfileForm(data, instance=user) | ||
assert form.is_valid() is False | ||
assert user.measurement == 'metric' | ||
assert ('Measurement system invalid or not available' | ||
in form.errors['measurement']) | ||
|
||
def test_sanitize(self): | ||
user = UserFactory.create(email='[email protected]', | ||
password='imagine71') | ||
|