django: Testing POST-based views with json objects django: Testing POST-based views with json objects ajax ajax

django: Testing POST-based views with json objects


The documentation seems to imply that if you pass a content_type parameter to client.post, it will treat the data value as a document and POST it directly. So try this:

response = c.post('/ajax/call/', content_type='application/json', data=J_string)