summaryrefslogtreecommitdiff
path: root/tests/forms_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/forms_tests')
-rw-r--r--tests/forms_tests/tests/test_forms.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py
index 22675bb84b..99bcfe3417 100644
--- a/tests/forms_tests/tests/test_forms.py
+++ b/tests/forms_tests/tests/test_forms.py
@@ -941,8 +941,8 @@ value="Should escape < & > and <script>alert('xss')</
password2 = CharField(widget=PasswordInput)
def clean_password2(self):
- if (self.cleaned_data.get('password1') and self.cleaned_data.get('password2')
- and self.cleaned_data['password1'] != self.cleaned_data['password2']):
+ if (self.cleaned_data.get('password1') and self.cleaned_data.get('password2') and
+ self.cleaned_data['password1'] != self.cleaned_data['password2']):
raise ValidationError('Please make sure your passwords match.')
return self.cleaned_data['password2']
@@ -980,8 +980,8 @@ value="Should escape < & > and <script>alert('xss')</
def clean(self):
# Test raising a ValidationError as NON_FIELD_ERRORS.
- if (self.cleaned_data.get('password1') and self.cleaned_data.get('password2')
- and self.cleaned_data['password1'] != self.cleaned_data['password2']):
+ if (self.cleaned_data.get('password1') and self.cleaned_data.get('password2') and
+ self.cleaned_data['password1'] != self.cleaned_data['password2']):
raise ValidationError('Please make sure your passwords match.')
# Test raising ValidationError that targets multiple fields.
@@ -1120,8 +1120,8 @@ value="Should escape < & > and <script>alert('xss')</
password2 = CharField(widget=PasswordInput)
def clean(self):
- if (self.cleaned_data.get('password1') and self.cleaned_data.get('password2')
- and self.cleaned_data['password1'] != self.cleaned_data['password2']):
+ if (self.cleaned_data.get('password1') and self.cleaned_data.get('password2') and
+ self.cleaned_data['password1'] != self.cleaned_data['password2']):
raise ValidationError(
'Please make sure your passwords match.',
code='password_mismatch',
@@ -2309,8 +2309,8 @@ Password: <input type="password" name="password" /></li>
password2 = CharField(widget=PasswordInput)
def clean(self):
- if (self.cleaned_data.get('password1') and self.cleaned_data.get('password2')
- and self.cleaned_data['password1'] != self.cleaned_data['password2']):
+ if (self.cleaned_data.get('password1') and self.cleaned_data.get('password2') and
+ self.cleaned_data['password1'] != self.cleaned_data['password2']):
raise ValidationError('Please make sure your passwords match.')
return self.cleaned_data
@@ -2369,8 +2369,8 @@ Password: <input type="password" name="password" /></li>
password2 = CharField(widget=PasswordInput)
def clean(self):
- if (self.cleaned_data.get('password1') and self.cleaned_data.get('password2')
- and self.cleaned_data['password1'] != self.cleaned_data['password2']):
+ if (self.cleaned_data.get('password1') and self.cleaned_data.get('password2') and
+ self.cleaned_data['password1'] != self.cleaned_data['password2']):
raise ValidationError('Please make sure your passwords match.')
return self.cleaned_data