Skip to content

Commit 6862752

Browse files
DanielDaniel
Daniel
authored and
Daniel
committed
Black formatting
1 parent cd49e0f commit 6862752

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

debug_toolbar/panels/sql/tracking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _quote_expr(self, element):
9393
except DjangoUnicodeDecodeError:
9494
return repr(element)
9595
elif isinstance(element, six.binary_type):
96-
return '(binary data)'
96+
return "(binary data)"
9797
else:
9898
return repr(element)
9999

tests/panels/test_sql.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,23 +113,29 @@ def test_param_conversion(self):
113113
('["Foo", true, false]', "[10, 1]", '["2017-12-22 16:07:01"]'),
114114
)
115115

116-
@unittest.skipIf(connection.vendor in ('sqlite', 'postgresql'),
117-
'Mixing bytestrings and text is not allowed on PostgreSQL and'
118-
'SQLite')
116+
@unittest.skipIf(
117+
connection.vendor in ("sqlite", "postgresql"),
118+
"Mixing bytestrings and text is not allowed on PostgreSQL and SQLite"
119+
)
119120
def test_binary_param_force_text(self):
120121
self.assertEqual(len(self.panel._queries), 0)
121122

122123
with connection.cursor() as cursor:
123-
cursor.execute("SELECT * FROM auth_user WHERE username = %s", [b'\xff'])
124+
cursor.execute(
125+
"SELECT * FROM auth_user WHERE username = %s",
126+
[b'\xff']
127+
)
124128

125129
self.assertEqual(len(self.panel._queries), 1)
126-
self.assertEqual(self.panel._queries[0][1]['sql'],
127-
"SELECT * FROM auth_user WHERE username = '\ufffd'")
130+
self.assertEqual(
131+
self.panel._queries[0][1]["sql"],
132+
"SELECT * FROM auth_user WHERE username = '\ufffd'"
133+
)
128134

129135
self.panel.process_response(self.request, self.response)
130136
self.panel.generate_stats(self.request, self.response)
131137

132-
@unittest.skipUnless(connection.vendor != 'sqlite', 'Test invalid for SQLite')
138+
@unittest.skipUnless(connection.vendor != "sqlite", "Test invalid for SQLite")
133139
def test_raw_query_param_conversion(self):
134140
self.assertEqual(len(self.panel._queries), 0)
135141

0 commit comments

Comments
 (0)