Track subqueries in Q filter values in catch_queries().

Review Request #13404 — Created Nov. 6, 2023 and submitted — Latest diff uploaded

Information

Djblets
release-3.x

Reviewers

catch_queries() now looks for Q(key=SubQuery) expressions, such as
Q(pk__in=MyModel.objects.all()), and records those expressions as
subqueries. This enables deeper comparison of these subqueries, rather
than the old behavior of comparing the resulting object lists.

Unit tests pass.

Verified that I could capture and compare the subqueries in some
in-progress unit tests.

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
Track subqueries in Q filter values in catch_queries().
`catch_queries()` now looks for `Q(key=SubQuery)` expressions, such as `Q(pk__in=MyModel.objects.all())`, and records those expressions as subqueries. This enables deeper comparison of these subqueries, rather than the old behavior of comparing the resulting object lists.
82bb678fd2b1b6c44e589f35bce68de4a484f6cc Christian Hammond
djblets/db/query_catcher.py
djblets/db/query_comparator.py
djblets/db/tests/test_query_catcher.py
Loading...