'Ajax requests should not redirect.'

def test_no_redirect_ajax(self):

    request = RequestFactory().get('/foo')
    request.META['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'
    request.user = AnonymousUser()
    view = permission_required('perm')(simple_view)
    response = view(request)
    eq_(403, response.status_code)
