          self.assertEquals(response.data, {'id': 1, 'text': 'foobar'})
          updated = self.objects.get(id=1)
          self.assertEquals(updated.text, 'foobar')
  
      # 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')
  
      def test_delete_instance_view(self):
          """
          DELETE requests to RetrieveUpdateDestroyAPIView should delete an object.
          """
 
</s> remove class InstanceView(generics.RetrieveUpdateDestroyAPIView):
 </s> add class InstanceView(generics.RetrievePartialUpdateDestroyAPIView): </s> remove factory = RequestFactory()
 </s> add factory = DRFRequestFactory() </s> remove     #     request = self.factory.post('/')
    #     response = view(request)
    #     self.assertEqual(response.status_code, 405)
 </s> add         request = self.factory.post('/')
        response = view(request)
        self.assertEqual(response.status_code, 405) </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     # def test_calling_patch_method(self):
 </s> add     def test_calling_patch_method(self):
    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')
          self.assertEquals(response.data, {'id': 1, 'text': 'foobar'})
          updated = self.objects.get(id=1)
          self.assertEquals(updated.text, 'foobar')
  
    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')
    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')
    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')
    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')
    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')
    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')
    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')
    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')
    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')
    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')
    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')
    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')
  
      def test_delete_instance_view(self):
          """
          DELETE requests to RetrieveUpdateDestroyAPIView should delete an object.
          """
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Adjust PATCH test cases to use the new DRFRequestFactory 
rest_framework/tests/generics.py