Opened 5 years ago
Closed 5 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 , 5 years ago
| Has patch: | set |
|---|
comment:2 by , 5 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:3 by , 5 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|---|
| Type: | New feature → Cleanup/optimization |
Note:
See TracTickets
for help on using tickets.
PR