Skip to content

Fix test_param_conversion for Django 4.1 and mysql #1526

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Nov 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tests/panels/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ def test_param_conversion(self):
# ensure query was logged
self.assertEqual(len(self.panel._queries), 3)

if django.VERSION >= (3, 1):
if (
django.VERSION >= (3, 1)
# Django 4.1 started passing true/false back for boolean
# comparisons in MySQL.
and not (django.VERSION >= (4, 1) and connection.vendor == "mysql")
):
self.assertEqual(
tuple([q[1]["params"] for q in self.panel._queries]),
('["Foo"]', "[10, 1]", '["2017-12-22 16:07:01"]'),
Expand Down