def test_ajax_post(self):
    self.client.ajax_post('auth/token', params={'a': ['1']})
    assert self.mock_c.request.called
    (method, path, body, headers) = self.mock_c.request.call_args[0]
    assert ('XMLHttpRequest' == headers['X-Requested-With'])
def test_ajax_post(self):
    self.client.ajax_post('auth/token', params={'a': ['1']})
    assert self.mock_c.request.called
    (method, path, body, headers) = self.mock_c.request.call_args[0]
    assert ('XMLHttpRequest' == headers['X-Requested-With'])