      #     request = self.factory.patch('/')
      #     response = view(request)
      #     self.assertEqual(response.status_code, 200)
  
      #     request = self.factory.post('/')
      #     response = view(request)
      #     self.assertEqual(response.status_code, 405)
  
      def test_renderer_classes(self):
  
          @api_view(['GET'])
          @renderer_classes([JSONRenderer])
 
</s> remove     #     request = self.factory.patch('/')
    #     response = view(request)
    #     self.assertEqual(response.status_code, 200)
 </s> add         request = self.factory.patch('/')
        response = view(request)
        self.assertEqual(response.status_code, 200) </s> remove     #     @api_view(['GET', 'PATCH'])
    #     def view(request):
    #         return Response({})
 </s> add         @api_view(['GET', 'PATCH'])
        def view(request):
            return Response({}) </s> remove     # def test_calling_patch_method(self):
 </s> add     def test_calling_patch_method(self): </s> remove     # def test_patch_instance_view(self):
    #     """
    #     PATCH requests to RetrieveUpdateDestroyAPIView should update an object.
    #     """
    #     content = {'text': 'foobar'}
    #     request = factory.patch('/1', json.dumps(content),
    #                           content_type='application/json')
    #     response = self.view(request, pk=1).render()
    #     self.assertEquals(response.status_code, status.HTTP_200_OK)
    #     self.assertEquals(response.data, {'id': 1, 'text': 'foobar'})
    #     updated = self.objects.get(id=1)
    #     self.assertEquals(updated.text, 'foobar')
 </s> add     def test_patch_instance_view(self):
        """
        PATCH requests to RetrieveUpdateDestroyAPIView should update an object.
        """
        content = {'text': 'foobar'}
        request = factory.patch('/1', json.dumps(content),
                              content_type='application/json')

        response = self.view(request, pk=1).render()
        self.assertEquals(response.status_code, status.HTTP_200_OK)
        self.assertEquals(response.data, {'id': 1, 'text': 'foobar'})
        updated = self.objects.get(id=1)
        self.assertEquals(updated.text, 'foobar') </s> remove         self.factory = RequestFactory()
 </s> add         self.factory = DRFRequestFactory()
        request = self.factory.post('/')
        response = view(request)
        self.assertEqual(response.status_code, 405)
      #     request = self.factory.patch('/')
      #     response = view(request)
      #     self.assertEqual(response.status_code, 200)
  
        request = self.factory.post('/')
        response = view(request)
        self.assertEqual(response.status_code, 405)
        request = self.factory.post('/')
        response = view(request)
        self.assertEqual(response.status_code, 405)
        request = self.factory.post('/')
        response = view(request)
        self.assertEqual(response.status_code, 405)
  
      def test_renderer_classes(self):
  
          @api_view(['GET'])
          @renderer_classes([JSONRenderer])
keep keep keep keep replace replace replace keep keep keep keep keep
 Adjust PATCH test cases to use the new DRFRequestFactory 
rest_framework/tests/decorators.py