#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):
Replying to [comment:1 Mariusz Felisiak]:
> This change would be backward incompatible because an output is
completely different. Moreover `assertCountEqual()` doesn't support
`maxDiff` (see #32469). I don't think it's worth changing.
The output will be different but is not true that it does not support for
maxDiff, since it is part of standard library and like other standard
methods uses the same truncation logic,
[[https://github.com/python/cpython/blob/a03a09e068435f47d02649dda93988dc44ffaaf1/Lib/unittest/case.py#L1199|
See source]].
Having a custom implementation of `assertCountEqual` in
`assertQuerysetEqual` would not be DRY. Also is much easier to understand
assertion output with unittests method than with the current
implementation.
--
Ticket URL: <https://code.djangoproject.com/ticket/33609#comment:2>
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/0107017fdb755c86-12d79322-64c0-45af-8ecd-1316d4985244-000000%40eu-central-1.amazonses.com.