#33609: Use assertCountEqual() in assertQuerysetEqual().
-------------------------------------+-------------------------------------
Reporter: David | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Testing framework | Version: dev
Severity: Normal | Resolution: wontfix
Keywords: queryseteuql | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by David):
To be more concise: this is the output with current implementation
{{{
Count[330 chars]': 1, 'Joe Smith 18': 1, 'Joe Smith 19': 1}) != Count[330
chars]': 1, 'Joe Smith 18': 1, 'Joe Smith 19': 1, 'Extra Person': 1})
Counter({'Joe Smith 0': 1,
'Joe Smith 1': 1,
'Joe Smith 2': 1,
'Joe Smith 3': 1,
'Joe Smith 4': 1,
'Joe Smith 5': 1,
'Joe Smith 6': 1,
'Joe Smith 7': 1,
'Joe Smith 8': 1,
'Joe Smith 9': 1,
'Joe Smith 10': 1,
'Joe Smith 11': 1,
'Joe Smith 12': 1,
'Joe Smith 13': 1,
'Joe Smith 14': 1,
'Joe Smith 15': 1,
'Joe Smith 16': 1,
'Joe Smith 17': 1,
'Joe Smith 18': 1,
- 'Joe Smith 19': 1})
? ^^
+ 'Joe Smith 19': 1,
? ^
+ 'Extra Person': 1})..
}}}
Versus this, which is the output for the same input with
`assertCountEqual`
{{{
Element counts were not equal:
First has 0, Second has 1: 'Extra Person'
}}}
And last the proof for maxDiff (I had to put 20 extra elements to be sure
it was generated):
{{{
# default maxDiff
Element counts were not equal:
Diff is 909 characters long. Set self.maxDiff to None to see it.
# maxDiff = None
Element counts were not equal:
First has 0, Second has 1: 'Extra Person 0'
First has 0, Second has 1: 'Extra Person 1'
First has 0, Second has 1: 'Extra Person 2'
First has 0, Second has 1: 'Extra Person 3'
First has 0, Second has 1: 'Extra Person 4'
First has 0, Second has 1: 'Extra Person 5'
First has 0, Second has 1: 'Extra Person 6'
First has 0, Second has 1: 'Extra Person 7'
First has 0, Second has 1: 'Extra Person 8'
First has 0, Second has 1: 'Extra Person 9'
First has 0, Second has 1: 'Extra Person 10'
First has 0, Second has 1: 'Extra Person 11'
First has 0, Second has 1: 'Extra Person 12'
First has 0, Second has 1: 'Extra Person 13'
First has 0, Second has 1: 'Extra Person 14'
First has 0, Second has 1: 'Extra Person 15'
First has 0, Second has 1: 'Extra Person 16'
First has 0, Second has 1: 'Extra Person 17'
First has 0, Second has 1: 'Extra Person 18'
First has 0, Second has 1: 'Extra Person 19'
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33609#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107017fdba46f98-34e546ff-5074-49ea-b9d1-36042c4ffe91-000000%40eu-central-1.amazonses.com.