Opened 11 years ago
Last modified 2 months ago
#21286 assigned Bug
Fix commented out tests in serializers.test_data
Reported by: | Tim Graham | Owned by: | Adam Zapletal |
---|---|---|---|
Component: | Core (Serialization) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | bmispelon@…, Adam Zapletal, Ülgen Sarıkavak | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Pull Requests: | |||
Description (last modified by ) ¶
tests/serializers/test_data.py
contains some commented out items in the test_data
list. I think it may be because not all serializers support those items. If this is the case, we should make appropriate modifications so the tests are run where they are supported and skipped where not.
According to the ticket's flags, the next step(s) to move this issue forward are:
- To provide a patch by sending a pull request. Claim the ticket when you start working so that someone else doesn't duplicate effort. Before sending a pull request, review your work against the patch review checklist. Check the "Has patch" flag on the ticket after sending a pull request and include a link to the pull request in the ticket comment when making that update. The usual format is:
[https://github.com/django/django/pull/#### PR]
.
Change History (29)
comment:1 by , 11 years ago
Cc: | added |
---|
comment:5 by , 7 years ago
Description: | modified (diff) |
---|---|
Summary: | Fix commented out tests in serializers_regress → Fix commented out tests in serializers.test_data |
comment:6 by , 7 years ago
@claude Your latest commit caused quite a few failures, did you forget to commit some code?
comment:7 by , 7 years ago
Argh, sorry! I was fooled by the fact the missing YAML lib in my test virtualenv wasn't showing by a skipped ('s') test. I will revert ASAP and try to work on that skip issue.
comment:10 by , 12 months ago
Cc: | added |
---|
comment:11 by , 12 months ago
Has patch: | set |
---|
I started looking at this ticket today to see if it was still valid and submitted a small PR removing what I believe are some invalid commented-out test cases.
comment:13 by , 12 months ago
Has patch: | unset |
---|
comment:14 by , 11 months ago
Cc: | added |
---|
comment:15 by , 3 months ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:16 by , 3 months ago
Has patch: | set |
---|
I opened a PR uncommenting and adding a fix for TimePKData
.
comment:18 by , 3 months ago
Has patch: | unset |
---|
comment:19 by , 3 months ago
Has patch: | set |
---|
I opened a PR uncommenting and adding a fix for TextPKData
.
comment:20 by , 3 months ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:22 by , 3 months ago
Has patch: | unset |
---|
comment:23 by , 3 months ago
Triage Stage: | Ready for checkin → Accepted |
---|
comment:24 by , 2 months ago
Has patch: | set |
---|
I opened a PR enabling the ImageField data tests in the same way that FileField is currently tested.
comment:25 by , 2 months ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:27 by , 2 months ago
Has patch: | unset |
---|---|
Triage Stage: | Ready for checkin → Accepted |
comment:28 by , 2 months ago
The final commented-out tests are blocked by #10244. I'll shift my focus to that ticket.
While looking into this, I believe I found the reason why some of the tests are commented: https://github.com/django/django/blob/8d6953d55c3aba04bbaf0f268499d6e405c653ff/tests/serializers_regress/models.py#L168-L170
The comment is not completely correct however because a few of the commented out models trigger and error immediately, regardless of the backend (
TypeError: 'primary_key' is not a valid argument for ...
).FilePKData
,ImagePKData
andNullBooleanPKData
can be deleted because of this.DatePKData
,DateTimePKData
,TimePKData
andTextPKData
might be database-dependent (they all work under sqlite).FileData
) might be worth looking into a bit deeper. It fails when uncommented and I believe it might be caused by the weirdFileField.__eq__
implementation.