Skip to content

Tests for SQLite environments with tox are failing for boolean parameters expected just in Django 6.2. #2398

Description

@marcosalvesdev

Description

The test tests/panels/test_sql.SQLPanelTestCase.test_param_conversion fails in the py312-dj60-sqlite, py313-dj60-sqlite, and py314-dj60-sqlite CI environments.

Root cause

PR #2385 added the condition django.VERSION >= (6, 2) to expect True/False in boolean parameters for non-PostgreSQL databases. The behavior change was actually introduced in Django 6.1, not 6.2. With pip_pre = True in tox.ini and dj60: django~=6.0 (which resolves to any 6.x release including pre-releases), the dj60 environments now install Django 6.1b1 (released June 24, 2026), which already passes True/False as boolean parameters on SQLite.

Why didn't PR #2385 catch this?

When PR #2385 was merged (June 16, 2026), django~=6.0 with pip_pre = True resolved to Django 6.1a1, which did not yet have this boolean behavior. Django 6.1b1, which introduced the change, was published 8 days later. Additionally, tox reuses existing environments unless --recreate is passed or declared dependencies change — so any local run after PR #2385 that had a cached environment with 6.1a1 would have continued passing, masking the issue.

This can also be confirmed empirically: Django 6.0.6 (the latest stable release) does not exhibit this behavior — boolean parameters are not passed for SQLite lookups. The change only appears starting from 6.1b1.

Fix

In tests/panels/test_sql.py, line 406, change:
and django.VERSION >= (6, 2)
to:
and django.VERSION >= (6, 1)

Steps to reproduce

  1. Install tox: pip install tox
  2. Run the failing test:
    tox -e py312-dj60-sqlite --recreate -- tests.panels.test_sql.SQLPanelTestCase.test_param_conversion
    ▎ Note: Replace py312 with py313 or py314 depending on the Python version available in your environment. The issue reproduces on any of these versions as long as pip_pre = True is active (the default in tox.ini), which causes django~=6.0 to resolve to Django 6.1b1 instead of the latest stable 6.0.x release.

Expected result

Ran 1 test in Xs
OK

Actual result

FAIL: test_param_conversion (tests.panels.test_sql.SQLPanelTestCase.test_param_conversion)
AssertionError: Tuples differ: (['Foo', True, False], [10, 1], ['2017-12-22 16:07:01']) != (['Foo'], [10, 1], ['2017-12-22 16:07:01'])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions