Sorry, replying on ticket.
On 29 January 2018 at 16:53, Nick Sarbicki
wrote:
> There's been a longer discussion on the ticket about this. The point you
> raise I agree with. I also think _encode_data should be left alone.
>
> I still think this should be in framework instead of having to subclas
There's been a longer discussion on the ticket about this. The point you
raise I agree with. I also think _encode_data should be left alone.
I still think this should be in framework instead of having to subclass
RequestFactory. Passing in a dict as data should not give invalid JSON.
Instead it w
>
> the JSON it produces (it does try)
>
I wouldn't say it "tries", it just calls str on any object that is passed
in, which for a simple dict with strings in, looks close to JSON.
force_bytes definitely shouldn't be trying to JSON-coerce things.
Thus I don't think it's a bug. Bugs are when behav
I've just posted a ticket for this
here: https://code.djangoproject.com/ticket/29082#ticket
The general point is that when I'm using RequestFactory and making a post
request with a JSON body, I'd expect to be able to pass in a dict for this
- but I can't as the JSON it produces (it does try) is