#30735: Testing client encode_multipart may also support dict format.
-------------------------------------+-------------------------------------
Reporter: Yannick Chabbert | Owner: Yannick
| Chabbert
Type: New feature | Status: closed
Component: Testing framework | Version: master
Severity: Normal | Resolution: wontfix
Keywords: test | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Yannick Chabbert):
Thanks for the quick answer. I agree with you and it clearly needs more
search before suggesting an helper like this.
What I'm still not sure and I still don't understand yet is why it works
in real life (sending data dict as json string along with file)!!?
* It is the DRF parser which '''magically''' detect that the string is a
json format and thus, deserialize it?
* Or it happen elsewhere, at a lower level in Django itself?
* This parsing behaviour is wanted or just a side effect?
* Afterall, even if it work, is it RFC compliant to send json data '''as
string''' with multipart content type?
The big deal to me is not really to have this helper just like for list or
file (because finally, we could do it manually) but to understand why this
exception is raised and if there is a good reason to do this? If true, it
means that we '''should't''' do this and parser should be fixed to failed
instead. Otherwise, exception shouldn't be raised and give an helper to
dumps data as json at a lowest level in Django (that's why I open this
issue in the Django project and not in DRF)...
Indeed at the begining, I was thinking: "ok, test failed because an
exception is raised to tell me it is not possible". Sad story but ok, this
is it. But after discovering that it works in real life, I'm saying: "Oooh
good catch! In fact, it works!! So this exception is maybe wrong??"
I will try to investigate more deeply on it and give some feedbacks.
--
Ticket URL: <https://code.djangoproject.com/ticket/30735#comment:6>
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/063.21a9e642a6221c76729772ddba5c3a7c%40djangoproject.com.