[Answered ]-Test Django Forms submitted through Ajax view

2👍

I hope I get a better solution, but for now, my solution was to remove content_type and post a dictionary.

In tests.py the code for the var response is:

  response = self.client.post(reverse('edit_something'), data)

This makes the view receive the appropriate values, while when I add content_type='application/json' the view request.POST is empty.

Leave a comment