mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #23395 -- Limited line lengths to 119 characters.
This commit is contained in:
parent
84b0a8d2aa
commit
b1e33ceced
130 changed files with 5259 additions and 1501 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue