'Tests that HTTP PUT and DELETE methods can get through with
X-CSRFToken and a cookie'

def test_put_and_delete_allowed(self):

    req = self._get_GET_csrf_cookie_request()
    req.method = u'PUT'
    req.META[u'HTTP_X_CSRFTOKEN'] = self._csrf_id
    req2 = CsrfViewMiddleware().process_view(req, post_form_view, (), {})
    self.assertEqual(None, req2)
    req = self._get_GET_csrf_cookie_request()
    req.method = u'DELETE'
    req.META[u'HTTP_X_CSRFTOKEN'] = self._csrf_id
    req2 = CsrfViewMiddleware().process_view(req, post_form_view, (), {})
    self.assertEqual(None, req2)
