Opened 4 years ago
Closed 4 years ago
#32469 closed Cleanup/optimization (fixed)
Add support for maxDiff to TransactionTestCase.assertQuerysetEqual().
Reported by: | Nick Pope | Owned by: | Nick Pope |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Normal | Keywords: | maxDiff, assertQuerysetEqual |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
TransactionTestCase.assertQuerysetEqual()
does not respect maxDiff
when ordered=False
.
So it turns out that although assertQuerySet()
with ordered=False
compares two instances of collection.Counter()
- a subclass of dict
- calling assertEqual()
will not defer to assertDictEqual()
and so maxDiff
isn't supported. We should use assertDictEqual()
explicitly.
See the following links for details:
Change History (4)
comment:1 by , 4 years ago
Has patch: | set |
---|
comment:2 by , 4 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 4 years ago
Triage Stage: | Accepted → Ready for checkin |
---|---|
Type: | New feature → Cleanup/optimization |
Note:
See TracTickets
for help on using tickets.
PR