'HTTP PUT and DELETE methods have protection'

def test_put_and_delete_rejected(self):

    req = TestingHttpRequest()
    req.method = 'PUT'
    with patch_logger('django.security.csrf', 'warning') as logger_calls:
        req2 = CsrfViewMiddleware().process_view(req, post_form_view, (), {})
        self.assertEqual(403, req2.status_code)
        self.assertEqual(logger_calls[0], ('Forbidden    (%s):    ' % REASON_NO_CSRF_COOKIE))
    req = TestingHttpRequest()
    req.method = 'DELETE'
    with patch_logger('django.security.csrf', 'warning') as logger_calls:
        req2 = CsrfViewMiddleware().process_view(req, post_form_view, (), {})
        self.assertEqual(403, req2.status_code)
        self.assertEqual(logger_calls[0], ('Forbidden    (%s):    ' % REASON_NO_CSRF_COOKIE))
