          response = self.view(request, pk=1).render()
          self.assertEquals(response.status_code, status.HTTP_200_OK)
          self.assertEquals(response.data, self.data[0])
  
      def test_put_instance_view(self):
          """
          PUT requests to InstanceAPIView should update an object.
          """
 
</s> remove         view = InstanceView.as_view()
 </s> add  </s> remove         response = view(request, pk=1).render()
 </s> add         response = self.view(request, pk=1).render() </s> remove         view = InstanceView.as_view()
 </s> add  </s> remove         response = view(request, pk=1).render()
 </s> add         response = self.view(request, pk=1).render() </s> remove         view = InstanceView.as_view()
 </s> add 
    def test_post_instance_view(self):
        """
        POST requests to InstanceAPIView should not be allowed
        """
        content = {'text': 'foobar'}
        request = factory.post('/', json.dumps(content), content_type='application/json')
        response = self.view(request).render()
        self.assertEquals(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
        self.assertEquals(response.content, '{"detail": "Method \'POST\' not allowed."}')

          response = self.view(request, pk=1).render()
          self.assertEquals(response.status_code, status.HTTP_200_OK)
          self.assertEquals(response.data, self.data[0])
  
    def test_post_instance_view(self):
        """
        POST requests to InstanceAPIView should not be allowed
        """
        content = {'text': 'foobar'}
        request = factory.post('/', json.dumps(content), content_type='application/json')
        response = self.view(request).render()
        self.assertEquals(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
        self.assertEquals(response.content, '{"detail": "Method \'POST\' not allowed."}')

      def test_put_instance_view(self):
          """
          PUT requests to InstanceAPIView should update an object.
          """
keep keep keep add keep keep keep keep
 Add more tests for generic views 
rest_framework/tests/generics.py