#29687: Make the test client serialize JSON types other than dict
--------------------------------------+------------------------------------
Reporter: danpalmer | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Testing framework | Version: 2.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by danpalmer):
So, while implementing I've found a minor edge case.
From the Python docs
[https://docs.python.org/3/library/json.html#json.JSONEncoder table of
Python to JSON type conversions] list:
||= Python =||= JSON =||
|| int, float, int- & float-derived Enums || number ||
Unfortunately I can't figure out how to test a float-derived enum. I don't
use Python Enums much, so I might just be getting this wrong, but looking
at the [https://github.com/python/cpython/blob/3.5/Lib/json/encoder.py
source for the standard JSONEncoder], I can't see any mention of support
for this feature. It explicitly calls out {{{IntEnums}}}, but nothing
float related for them.
For these reasons, I'm going to just leave this.
--
Ticket URL: <https://code.djangoproject.com/ticket/29687#comment:7>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.08d347c3db5c6d8b801ed9337b0f4541%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.