#27622: Testing client should accept vendor tree json variants
-------------------------------------+-------------------------------------
     Reporter:  John Gresty          |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Testing framework    |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  json vendor          |             Triage Stage:  Accepted
  testing_client                     |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Adam Chainz):

 The regex mentions `vnd.bigcompany.funnypictures` as a possible vendor
 name which the suggested regex won't parse. Maybe django can use a looser
 regex like `r'^application\/(vnd\..+\+)?json$'` as per the robustness
 principle.

 Or maybe even drop the header check - if a test calls `resp.json()` it's
 already 99.99% sure the response is in JSON, and if it's not, what's wrong
 with the test giving a `JSONDecodeError`? (Maybe heading into backwards
 incompatible territory there though).

--
Ticket URL: <https://code.djangoproject.com/ticket/27622#comment:5>
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.07f9b7348a3949cfdee00f64ab195401%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to