  class NullableOneToOneSource(RESTFrameworkModel):
      name = models.CharField(max_length=100)
      target = models.OneToOneField(OneToOneTarget, null=True, blank=True,
                                    related_name='nullable_source')
  
  
  # Inherited
  class ParentModel(RESTFrameworkModel):
      name1 = models.CharField(max_length=100)
  
  
  class ChildModel(ParentModel):
      name2 = models.CharField(max_length=100)
  
  
  class AssociatedModel(RESTFrameworkModel):
      ref = models.OneToOneField(ParentModel, primary_key=True)
      name = models.CharField(max_length=100)
 
</s> remove     def test_multitable_inherited_model_fields_as_expected(self):
        """
        Assert that the parent pointer field is not included in the fields
        serialized fields
        """
        child = ChildModel(name1='parent name', name2='child name')
        serializer = DerivedModelSerializer(child)
        self.assertEqual(set(serializer.data.keys()),
                         set(['name1', 'name2', 'id']))

    def test_onetoone_primary_key_model_fields_as_expected(self):
        """
        Assert that a model with a onetoone field that is the primary key is
        not treated like a derived model
        """
        parent = ParentModel(name1='parent name')
        associate = AssociatedModel(name='hello', ref=parent)
        serializer = AssociatedModelSerializer(associate)
        self.assertEqual(set(serializer.data.keys()),
                         set(['name', 'ref']))

 </s> add  </s> remove     def test_multitable_inherited_model(self):
        data = {
            'name1': 'parent name',
            'name2': 'child name',
        }
        serializer = DerivedModelSerializer(data=data)
        self.assertEqual(serializer.is_valid(), True)

 </s> add  </s> remove     ManyToManyModel, Person, ReadOnlyManyToManyModel, Photo, ParentModel, ChildModel,
    AssociatedModel)
 </s> add     ManyToManyModel, Person, ReadOnlyManyToManyModel, Photo)
from rest_framework.tests.multitable_inheritance import (ParentModel,
    ChildModel, AssociatedModel)
  class NullableOneToOneSource(RESTFrameworkModel):
      name = models.CharField(max_length=100)
      target = models.OneToOneField(OneToOneTarget, null=True, blank=True,
                                    related_name='nullable_source')














keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace
 Group the model-inheritance-related tests together 
rest_framework/tests/models.py