#29520: Posting bytes broken in 2.1 TestClient
---------------------------------------------+------------------------
               Reporter:  Mathias Ertl       |          Owner:  nobody
                   Type:  Bug                |         Status:  new
              Component:  Testing framework  |        Version:  2.1
               Severity:  Normal             |       Keywords:
           Triage Stage:  Unreviewed         |      Has patch:  0
    Needs documentation:  0                  |    Needs tests:  0
Patch needs improvement:  0                  |  Easy pickings:  0
                  UI/UX:  0                  |
---------------------------------------------+------------------------
 b8a41a2872624a6d9e61308932dd81d001e31eb9 removes the `force_bytes` method
 for encoding data in post requests with `data.encode()`. This breaks the
 usecase of posting `data=bytes` to `TestClient.post()`, since that type
 does not have that function. The old implementation of course just
 returned the same value unchanged in case of a bytes value.

 A simple fix would be to add an `if not isinstance(bytes, data)` check
 before invoking the `_encode_data` function.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29520>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/054.9c973852572a819c370f458428efd00d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to