summaryrefslogtreecommitdiff
path: root/tests/test_client_regress
diff options
context:
space:
mode:
authorDražen Odobašić <dodobas@candela-it.com>2015-09-11 19:33:12 -0400
committerTim Graham <timograham@gmail.com>2015-09-12 11:40:50 -0400
commitb1e33ceceda1e75ff68c7deed8f6659683a195d3 (patch)
treee4e446f69194f2dc3c9c7ee3ecf48290ea8d4d31 /tests/test_client_regress
parent84b0a8d2aad042fb573df5055b6153770d0929ac (diff)
Fixed #23395 -- Limited line lengths to 119 characters.
Diffstat (limited to 'tests/test_client_regress')
-rw-r--r--tests/test_client_regress/tests.py58
1 files changed, 49 insertions, 9 deletions
diff --git a/tests/test_client_regress/tests.py b/tests/test_client_regress/tests.py
index a492fd6e76..500c28f9ae 100644
--- a/tests/test_client_regress/tests.py
+++ b/tests/test_client_regress/tests.py
@@ -261,12 +261,20 @@ class AssertTemplateUsedTests(TestDataMixin, TestCase):
try:
self.assertTemplateUsed(response, 'Empty POST Template')
except AssertionError as e:
- self.assertIn("Template 'Empty POST Template' was not a template used to render the response. Actual template(s) used: Empty GET Template", str(e))
+ self.assertIn(
+ "Template 'Empty POST Template' was not a template used to "
+ "render the response. Actual template(s) used: Empty GET Template",
+ str(e)
+ )
try:
self.assertTemplateUsed(response, 'Empty POST Template', msg_prefix='abc')
except AssertionError as e:
- self.assertIn("abc: Template 'Empty POST Template' was not a template used to render the response. Actual template(s) used: Empty GET Template", str(e))
+ self.assertIn(
+ "abc: Template 'Empty POST Template' was not a template used "
+ "to render the response. Actual template(s) used: Empty GET Template",
+ str(e)
+ )
with self.assertRaises(AssertionError) as context:
self.assertTemplateUsed(response, 'Empty GET Template', count=2)
@@ -307,7 +315,11 @@ class AssertTemplateUsedTests(TestDataMixin, TestCase):
try:
self.assertTemplateUsed(response, "Valid POST Template")
except AssertionError as e:
- self.assertIn("Template 'Valid POST Template' was not a template used to render the response. Actual template(s) used: form_view.html, base.html", str(e))
+ self.assertIn(
+ "Template 'Valid POST Template' was not a template used to "
+ "render the response. Actual template(s) used: form_view.html, base.html",
+ str(e)
+ )
with self.assertRaises(AssertionError) as context:
self.assertTemplateUsed(response, 'base.html', count=2)
@@ -369,13 +381,21 @@ class AssertRedirectsTests(SimpleTestCase):
# The redirect target responds with a 301 code, not 200
self.assertRedirects(response, 'http://testserver/permanent_redirect_view/')
except AssertionError as e:
- self.assertIn("Couldn't retrieve redirection page '/permanent_redirect_view/': response code was 301 (expected 200)", str(e))
+ self.assertIn(
+ "Couldn't retrieve redirection page '/permanent_redirect_view/': "
+ "response code was 301 (expected 200)",
+ str(e)
+ )
try:
# The redirect target responds with a 301 code, not 200
self.assertRedirects(response, 'http://testserver/permanent_redirect_view/', msg_prefix='abc')
except AssertionError as e:
- self.assertIn("abc: Couldn't retrieve redirection page '/permanent_redirect_view/': response code was 301 (expected 200)", str(e))
+ self.assertIn(
+ "abc: Couldn't retrieve redirection page '/permanent_redirect_view/': "
+ "response code was 301 (expected 200)",
+ str(e)
+ )
def test_redirect_chain(self):
"You can follow a redirect chain of multiple redirects"
@@ -615,11 +635,23 @@ class AssertFormErrorTests(SimpleTestCase):
try:
self.assertFormError(response, 'form', 'email', 'Some error.')
except AssertionError as e:
- self.assertIn(str_prefix("The field 'email' on form 'form' in context 0 does not contain the error 'Some error.' (actual errors: [%(_)s'Enter a valid email address.'])"), str(e))
+ self.assertIn(
+ str_prefix(
+ "The field 'email' on form 'form' in context 0 does not "
+ "contain the error 'Some error.' (actual errors: "
+ "[%(_)s'Enter a valid email address.'])"
+ ), str(e)
+ )
try:
self.assertFormError(response, 'form', 'email', 'Some error.', msg_prefix='abc')
except AssertionError as e:
- self.assertIn(str_prefix("abc: The field 'email' on form 'form' in context 0 does not contain the error 'Some error.' (actual errors: [%(_)s'Enter a valid email address.'])"), str(e))
+ self.assertIn(
+ str_prefix(
+ "abc: The field 'email' on form 'form' in context 0 does "
+ "not contain the error 'Some error.' (actual errors: "
+ "[%(_)s'Enter a valid email address.'])",
+ ), str(e)
+ )
def test_unknown_nonfield_error(self):
"""
@@ -640,11 +672,19 @@ class AssertFormErrorTests(SimpleTestCase):
try:
self.assertFormError(response, 'form', None, 'Some error.')
except AssertionError as e:
- self.assertIn("The form 'form' in context 0 does not contain the non-field error 'Some error.' (actual errors: )", str(e))
+ self.assertIn(
+ "The form 'form' in context 0 does not contain the non-field "
+ "error 'Some error.' (actual errors: )",
+ str(e)
+ )
try:
self.assertFormError(response, 'form', None, 'Some error.', msg_prefix='abc')
except AssertionError as e:
- self.assertIn("abc: The form 'form' in context 0 does not contain the non-field error 'Some error.' (actual errors: )", str(e))
+ self.assertIn(
+ "abc: The form 'form' in context 0 does not contain the "
+ "non-field error 'Some error.' (actual errors: )",
+ str(e)
+ )
@override_settings(ROOT_URLCONF='test_client_regress.urls')