summaryrefslogtreecommitdiff
path: root/tests/forms_tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-04-03 20:37:32 -0400
committerTim Graham <timograham@gmail.com>2016-04-04 17:14:26 -0400
commit2cd2d188516475ddf256e6267cd82c495fb5c430 (patch)
tree1a7c3c167c1576923c7c4f5544495face5bd7327 /tests/forms_tests
parentd356bb653f4d90ae9809e5a051791ded39010c38 (diff)
Fixed W503 flake8 warnings.
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 &lt; &amp; &gt; and &lt;script&gt;alert(&#39;xss&#39;)&lt;/
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 &lt; &amp; &gt; and &lt;script&gt;alert(&#39;xss&#39;)&lt;/
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 &lt; &amp; &gt; and &lt;script&gt;alert(&#39;xss&#39;)&lt;/
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