Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel authored and Daniel committed Nov 7, 2018
1 parent 201a65b commit 614bca1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/panels/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,17 @@ def test_param_conversion(self):
))

@unittest.skipIf(connection.vendor in ('sqlite', 'postgresql'),
'Mixing bytestrings and text is not allowed on PostgreSQL and SQLite')
'Mixing bytestrings and text is not allowed on PostgreSQL and'
'SQLite')
def test_binary_param_force_text(self):
self.assertEqual(len(self.panel._queries), 0)

with connection.cursor() as cursor:
cursor.execute("SELECT * FROM auth_user WHERE username = %s", [b'\xff'])

self.assertEqual(len(self.panel._queries), 1)
self.assertEqual(self.panel._queries[0][1]['sql'], "SELECT * FROM auth_user WHERE username = '\ufffd'")
self.assertEqual(self.panel._queries[0][1]['sql'],
"SELECT * FROM auth_user WHERE username = '\ufffd'")

self.panel.process_response(self.request, self.response)
self.panel.generate_stats(self.request, self.response)
Expand Down

0 comments on commit 614bca1

Please sign in to comment.