1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #33476 -- Refactored problematic code before reformatting by Black.

In these cases Black produces unexpected results, e.g.

def make_random_password(
    self,
    length=10,
    allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789',
):

or

cursor.execute("""
SELECT ...
""",
    [table name],
)
This commit is contained in:
Mariusz Felisiak
2022-02-03 11:20:46 +01:00
committed by GitHub
parent c9d6e3595c
commit c5cd878382
53 changed files with 227 additions and 217 deletions

View File

@@ -437,8 +437,7 @@ class AssertNumQueriesContextManagerTests(TestCase):
def test_failure(self):
msg = (
'1 != 2 : 1 queries executed, 2 expected\nCaptured queries were:\n'
'1.'
'1 != 2 : 1 queries executed, 2 expected\nCaptured queries were:\n1.'
)
with self.assertRaisesMessage(AssertionError, msg):
with self.assertNumQueries(2):
@@ -927,11 +926,7 @@ class HTMLEqualTests(SimpleTestCase):
parse_html('</p>')
def test_escaped_html_errors(self):
msg = (
'<p>\n<foo>\n</p>'
' != '
'<p>\n&lt;foo&gt;\n</p>\n'
)
msg = '<p>\n<foo>\n</p> != <p>\n&lt;foo&gt;\n</p>\n'
with self.assertRaisesMessage(AssertionError, msg):
self.assertHTMLEqual('<p><foo></p>', '<p>&lt;foo&gt;</p>')
with self.assertRaisesMessage(AssertionError, msg):