Fix showing output for non-sortable sets of values.

Review Request #14386 — Created March 21, 2025 and submitted — Latest diff uploaded

Information

django-assert-queries
main

Reviewers

When showing output from a failed comparison where sets are involved, we
try to sort the values to provide consistent odering for comparison.
When doing this, we could hit an error saying that the values aren't
sortable, due to __lt__ not being implemented.

We now detect this case and sort by the representations of the values
instead.

All unit tests pass.

Verified this fixed issues encountered in some new unit tests in
Review Board.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

orig
1
2

Commits

First Last Summary ID Author
Fix showing output for non-sortable sets of values.
When showing output from a failed comparison where sets are involved, we try to sort the values to provide consistent odering for comparison. When doing this, we could hit an error saying that the values aren't sortable, due to `__lt__` not being implemented. We now detect this case and sort by the representations of the values instead.
e4eec708c1f93d988dfd6e3470fb8de26845462b Christian Hammond
django_assert_queries/query_comparator.py
django_assert_queries/tests/test_query_comparator.py
Loading...