#31235 closed New feature (fixed)
assertQuerysetEqual cannot compare querysets directly.
Reported by: | Peter Inglesby | Owned by: | Hasan Ramezani |
---|---|---|---|
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
As discussed briefly on django-dev [0] I'd like to modify assertQuerysetEqual
so that assertQuerysetEqual(qs1, qs2)
works.
[0] https://groups.google.com/forum/?#!msg/django-developers/wdO0e0835EY/X_D9gVe_EwAJ
Change History (11)
comment:1 by , 5 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 5 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
Patch needs improvement: | set |
Status: | new → assigned |
Summary: | assertQuerysetEqual cannot compare querysets directly → assertQuerysetEqual cannot compare querysets directly. |
Version: | 3.0 → master |
comment:4 by , 4 years ago
Patch needs improvement: | set |
---|
comment:5 by , 4 years ago
Mariusz:
I rebased the PR and changed a lot of assertions and remove repr
from assertQuerysetEqual
.
There are some assertions that are using repr
. most of them are for models that use more than one field in __str__
.
like:
- https://github.com/django/django/pull/13557/files#diff-ad6ec549eed244cc16532a3944710bfee97faeba6e3d21fbea58a5cb544254d2R1013
- https://github.com/django/django/pull/13557/files#diff-ad3486daf49a0018f6d9202fbdaf3392dda74e2543decf9bdc43f37d2ebec8b2R221
I think we can keep them as is. what do you think?
comment:6 by , 4 years ago
Patch needs improvement: | unset |
---|
comment:7 by , 4 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Note:
See TracTickets
for help on using tickets.
I think the suggested approach makes sense, I suggest we deprecate the
repr
default entirely through a deprecation period.