Opened 10 years ago

Closed 10 years ago

#23567 closed Bug (fixed)

assertQuerysetEqual does not check for repeated items when used with ordered=False

Reported by: Thomas C Owned by: nobody
Component: Testing framework Version: dev
Severity: Normal Keywords:
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

The current implementation falls back to set equality when the ordered argument is set to False. This makes assertQuerysetEqual unable to detect differences regarding the number of occurrences of each item.

The proposed PR uses Counter instead of set. This might break some tests as it is a more restrictive condition, but that might reveal potential bugs.

Change History (2)

comment:1 by Simon Charette, 10 years ago

Triage Stage: UnreviewedReady for checkin
Version: master

Issue is valid and the provided patch LGTM so far, let's wait for the PR build to complete.

comment:2 by Simon Charette <charette.s@…>, 10 years ago

Resolution: fixed
Status: newclosed

In 311b3ad9db94c3e04f929c2622be4f10d759f45e:

Fixed #23567 -- Made assertQuerysetEqual check Counter equality when ordered=False

Note: See TracTickets for help on using tickets.
Back to Top