Skip to content

Commit

Permalink
Mark binary payload as binary (same thing BinaryField.get_db_prep_val…
Browse files Browse the repository at this point in the history
…ue does)
  • Loading branch information
matthiask committed Nov 28, 2018
1 parent ad091e6 commit 901aed7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/panels/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ def test_binary_param_force_text(self):
self.assertEqual(len(self.panel._queries), 0)

with connection.cursor() as cursor:
cursor.execute("SELECT * FROM tests_binary WHERE field = %s", [b"\xff"])
cursor.execute(
"SELECT * FROM tests_binary WHERE field = %s",
[connection.Database.Binary(b"\xff")],
)

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

0 comments on commit 901aed7

Please sign in to comment.