          self.assertEquals(response.data, expected)
  
  
  class TestInstanceView(TestCase):
      def setUp(self):
          """
          Create 3 BasicModel intances.
 
</s> remove         Creates a default instance of a basic field.
 </s> add         Creates a default instance of a basic non-relational field. </s> remove             field.initialize(parent=self, model_field=model_field)
            ret[model_field.name] = field
 </s> add             if field is not None:
                field.initialize(parent=self, model_field=model_field)
                ret[model_field.name] = field
 </s> remove             if model_field.rel and nested:
 </s> add             if is_pk:
                field = self.get_pk_field(model_field)
                is_pk = False
            elif model_field.rel and nested:
    def test_post_cannot_set_id(self):
        """
        POST requests to create a new object should not be able to set the id.
        """
        content = {'id': 999, 'text': 'foobar'}
        request = factory.post('/', json.dumps(content), content_type='application/json')
        response = self.view(request).render()
        self.assertEquals(response.status_code, status.HTTP_201_CREATED)
        self.assertEquals(response.data, {'id': 4, 'text': u'foobar'})
        created = self.objects.get(id=4)
        self.assertEquals(created.text, 'foobar')

          self.assertEquals(response.data, expected)
  
    def test_post_cannot_set_id(self):
        """
        POST requests to create a new object should not be able to set the id.
        """
        content = {'id': 999, 'text': 'foobar'}
        request = factory.post('/', json.dumps(content), content_type='application/json')
        response = self.view(request).render()
        self.assertEquals(response.status_code, status.HTTP_201_CREATED)
        self.assertEquals(response.data, {'id': 4, 'text': u'foobar'})
        created = self.objects.get(id=4)
        self.assertEquals(created.text, 'foobar')

  
  class TestInstanceView(TestCase):
      def setUp(self):
          """
          Create 3 BasicModel intances.
keep add keep keep keep keep keep
 Fix bug where pk could be set in post data 
rest_framework/tests/generics.py