def test_require_safe_accepts_only_safe_methods(self):
        def my_view(request):
            return HttpResponse("OK")
        my_safe_view = require_safe(my_view)
        request = HttpRequest()
        request.method = 'GET'
        self.assertTrue(isinstance(my_safe_view(request), HttpResponse))
        request.method = 'HEAD'
        self.assertTrue(isinstance(my_safe_view(request), HttpResponse))
        request.method = 'POST'
        self.assertTrue(isinstance(my_safe_view(request), HttpResponseNotAllowed))
        request.method = 'PUT'
        self.assertTrue(isinstance(my_safe_view(request), HttpResponseNotAllowed))
        request.method = 'DELETE'
        self.assertTrue(isinstance(my_safe_view(request), HttpResponseNotAllowed))


# For testing method_decorator, a decorator that assumes a single argument.
# We will get type arguments if there is a mismatch in the number of arguments.
Test for the require_safe decorator.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/tests/regressiontests/decorators/tests.py/DecoratorsTest.test_require_safe_accepts_only_safe_methods