  )
  
  
  class DecoratorTestCase(TestCase):
  
      def setUp(self):
 
</s> remove         self.factory = RequestFactory()
 </s> add         self.factory = DRFRequestFactory() </s> remove class InstanceView(generics.RetrieveUpdateDestroyAPIView):
 </s> add class InstanceView(generics.RetrievePartialUpdateDestroyAPIView): </s> remove factory = RequestFactory()
 </s> add factory = DRFRequestFactory() </s> remove     # def test_calling_patch_method(self):
 </s> add     def test_calling_patch_method(self): </s> remove     #     @api_view(['GET', 'PATCH'])
    #     def view(request):
    #         return Response({})
 </s> add         @api_view(['GET', 'PATCH'])
        def view(request):
            return Response({})
from rest_framework.tests.utils import DRFRequestFactory

  )
  
from rest_framework.tests.utils import DRFRequestFactory

  
  class DecoratorTestCase(TestCase):
  
      def setUp(self):
keep add keep keep keep keep
 Adjust PATCH test cases to use the new DRFRequestFactory 
rest_framework/tests/decorators.py