Update query catching and comparison for Django 4.2.

Review Request #13453 — Created Dec. 7, 2023 and submitted — Latest diff uploaded

Information

Djblets
release-5.x

Reviewers

The new query catching and comparison code introduced in Djblets 3.4
wasn't quite compatible with Django 4.2, due to some changes in how some
queries and Q-expressions are built.

COUNT(*) queries are now generated slightly differently, with
different internals, affecting query expectations. This has been
updated in Djblets's tests, but this will impact consumers of query
comparison code outside of Djblets as well.

SQLite query syntax has changed for some operations, affecting Djblets
unit tests.

~Q(...) negated expressions are now represented differently
internally, using a NegatedExpression (a subclass of
ExpressionWrapper). These are now supported, serialized, represented,
and compared correctly.

Unit tests pass.

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
Update query catching and comparison for Django 4.2.
The new query catching and comparison code introduced in Djblets 3.4 wasn't quite compatible with Django 4.2, due to some changes in how some queries and Q-expressions are built. `COUNT(*)` queries are now generated slightly differently, with different internals, affecting query expectations. This has been updated in Djblets's tests, but this will impact consumers of query comparison code outside of Djblets as well. SQLite query syntax has changed for some operations, affecting Djblets unit tests. `~Q(...)` negated expressions are now represented differently internally, using a `NegatedExpression` (a subclass of `ExpressionWrapper`). These are now supported, serialized, represented, and compared correctly.
cb23421cda3dc081c972e368c29ae06617ed49bb Christian Hammond
djblets/db/query_catcher.py
djblets/db/query_comparator.py
djblets/db/tests/test_query_catcher.py
djblets/db/tests/test_query_comparator.py
Loading...