diff options
| author | Dražen Odobašić <dodobas@candela-it.com> | 2015-09-11 19:33:12 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-09-12 11:40:50 -0400 |
| commit | b1e33ceceda1e75ff68c7deed8f6659683a195d3 (patch) | |
| tree | e4e446f69194f2dc3c9c7ee3ecf48290ea8d4d31 /tests/test_utils/tests.py | |
| parent | 84b0a8d2aad042fb573df5055b6153770d0929ac (diff) | |
Fixed #23395 -- Limited line lengths to 119 characters.
Diffstat (limited to 'tests/test_utils/tests.py')
| -rw-r--r-- | tests/test_utils/tests.py | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py index 6869f49666..00c9c0fa2b 100644 --- a/tests/test_utils/tests.py +++ b/tests/test_utils/tests.py @@ -363,7 +363,8 @@ class AssertTemplateUsedContextManagerTests(SimpleTestCase): with self.assertTemplateUsed(template_name='template_used/base.html'): pass - with six.assertRaisesRegex(self, AssertionError, r'^template_used/base\.html.*template_used/alternative\.html$'): + with six.assertRaisesRegex( + self, AssertionError, r'^template_used/base\.html.*template_used/alternative\.html$'): with self.assertTemplateUsed('template_used/base.html'): render_to_string('template_used/alternative.html') @@ -519,13 +520,16 @@ class HTMLEqualTests(SimpleTestCase): <td><input type="text" value="1940-10-9" name="birthday" id="id_birthday" /></td></tr>""", """ <tr><th> - <label for="id_first_name">First name:</label></th><td><input type="text" name="first_name" value="John" id="id_first_name" /> + <label for="id_first_name">First name:</label></th><td> + <input type="text" name="first_name" value="John" id="id_first_name" /> </td></tr> <tr><th> - <label for="id_last_name">Last name:</label></th><td><input type="text" name="last_name" value="Lennon" id="id_last_name" /> + <label for="id_last_name">Last name:</label></th><td> + <input type="text" name="last_name" value="Lennon" id="id_last_name" /> </td></tr> <tr><th> - <label for="id_birthday">Birthday:</label></th><td><input type="text" name="birthday" value="1940-10-9" id="id_birthday" /> + <label for="id_birthday">Birthday:</label></th><td> + <input type="text" name="birthday" value="1940-10-9" id="id_birthday" /> </td></tr> """) @@ -645,7 +649,11 @@ class HTMLEqualTests(SimpleTestCase): def test_unicode_handling(self): response = HttpResponse('<p class="help">Some help text for the title (with unicode ŠĐĆŽćžšđ)</p>') - self.assertContains(response, '<p class="help">Some help text for the title (with unicode ŠĐĆŽćžšđ)</p>', html=True) + self.assertContains( + response, + '<p class="help">Some help text for the title (with unicode ŠĐĆŽćžšđ)</p>', + html=True + ) class JSONEqualTests(SimpleTestCase): @@ -805,9 +813,14 @@ class AssertFieldOutputTests(SimpleTestCase): def test_assert_field_output(self): error_invalid = ['Enter a valid email address.'] self.assertFieldOutput(EmailField, {'a@a.com': 'a@a.com'}, {'aaa': error_invalid}) - self.assertRaises(AssertionError, self.assertFieldOutput, EmailField, {'a@a.com': 'a@a.com'}, {'aaa': error_invalid + ['Another error']}) - self.assertRaises(AssertionError, self.assertFieldOutput, EmailField, {'a@a.com': 'Wrong output'}, {'aaa': error_invalid}) - self.assertRaises(AssertionError, self.assertFieldOutput, EmailField, {'a@a.com': 'a@a.com'}, {'aaa': ['Come on, gimme some well formatted data, dude.']}) + with self.assertRaises(AssertionError): + self.assertFieldOutput(EmailField, {'a@a.com': 'a@a.com'}, {'aaa': error_invalid + ['Another error']}) + with self.assertRaises(AssertionError): + self.assertFieldOutput(EmailField, {'a@a.com': 'Wrong output'}, {'aaa': error_invalid}) + with self.assertRaises(AssertionError): + self.assertFieldOutput( + EmailField, {'a@a.com': 'a@a.com'}, {'aaa': ['Come on, gimme some well formatted data, dude.']} + ) def test_custom_required_message(self): class MyCustomField(IntegerField): |
