Opened 4 years ago

Last modified 7 days ago

#21286 new Bug

Fix commented out tests in serializers.test_data

Reported by: Tim Graham Owned by: nobody
Component: Core (Serialization) Version: master
Severity: Normal Keywords:
Cc: bmispelon@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Claude Paroz)

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.

Change History (9)

comment:1 Changed 4 years ago by Baptiste Mispelon

Cc: bmispelon@… added

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 and NullBooleanPKData can be deleted because of this.
  • DatePKData, DateTimePKData, TimePKData and TextPKData might be database-dependent (they all work under sqlite).
  • Test case 51 (FileData) might be worth looking into a bit deeper. It fails when uncommented and I believe it might be caused by the weird FileField.__eq__ implementation.

comment:2 Changed 2 years ago by Claude Paroz

FileField and NULL value issue is tracked in #10244.

comment:3 Changed 4 months ago by Claude Paroz <claude@…>

In d02fc8d:

Refs #21286 -- Enabled serializer tests with date/datetime pk model

comment:4 Changed 8 days ago by Claude Paroz <claude@…>

In 01c6a3e:

Refs #21286 -- Enabled serializer tests with time pk model

comment:5 Changed 8 days ago by Claude Paroz

Description: modified (diff)
Summary: Fix commented out tests in serializers_regressFix commented out tests in serializers.test_data

comment:6 Changed 8 days ago by Florian Apolloner

@claude Your latest commit caused quite a few failures, did you forget to commit some code?

comment:7 Changed 7 days ago by Claude Paroz

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:8 Changed 7 days ago by Claude Paroz <claude@…>

In 256182c4:

Revert "Refs #21286 -- Enabled serializer tests with time pk model"

This reverts commit 01c6a3e227b645e8dea97e9befecd23d1d3b8581.
Unfortunately, the YAML serializer is not yet able to cope with time values.

comment:9 Changed 7 days ago by Claude Paroz

Missing skip issue in #28610.

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