'Check that we get a JSON response when requested via AJAX'

def test_view_index_xhr(self):

    resp = self.client.get(self.url, HTTP_ACCEPT='application/json', HTTP_X_REQUESTED_WITH='XMLHttpRequest')
    self.assertEqual(resp.status_code, 200)
    obj = json.loads(resp.content)
    self.assertEqual(self.course.pdf_textbooks, obj)
