Skip to content

Instantly share code, notes, and snippets.

@essanpupil
Last active November 21, 2016 07:17
Show Gist options
  • Select an option

  • Save essanpupil/25cd4ea79cc4b1404f47a0ddb511241e to your computer and use it in GitHub Desktop.

Select an option

Save essanpupil/25cd4ea79cc4b1404f47a0ddb511241e to your computer and use it in GitHub Desktop.
# taken from http://ericholscher.com/blog/2009/apr/16/testing-ajax-views-django/
response = self.client.post('/ratings/vote/', {'value': '1',}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
self.assertEqual(200, response.status_code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment