      target = models.OneToOneField(OneToOneTarget, related_name='source')
  
  
  
          class OneToOneTargetSerializer(serializers.ModelSerializer):
              source = OneToOneSourceSerializer()
  
 
</s> remove     target_source = models.OneToOneField(OneToOneTargetSource, related_name='source')


class OneToOneSourceSerializer(serializers.ModelSerializer):
    class Meta:
        model = OneToOneSource
        exclude = ('target_source', )

 </s> add     target = models.OneToOneField(OneToOneTarget, related_name='source') </s> remove class OneToOneTargetSource(models.Model):
    name = models.CharField(max_length=100)
    target = models.OneToOneField(OneToOneTarget, null=True, blank=True,
                                  related_name='target_source')


 </s> add  </s> remove class OneToOneTargetSerializer(serializers.ModelSerializer):
    target_source = OneToOneTargetSourceSerializer()
 </s> add         class OneToOneTargetSerializer(serializers.ModelSerializer):
            source = OneToOneSourceSerializer() </s> remove class OneToOneTargetSourceSerializer(serializers.ModelSerializer):
    source = OneToOneSourceSerializer()

    class Meta:
        model = OneToOneTargetSource
        exclude = ('target', )
 </s> add  </s> remove     class Meta:
        model = OneToOneTarget
 </s> add             class Meta:
                model = OneToOneTarget
                fields = ('id', 'name', 'source')
class ReverseNestedOneToOneTests(TestCase):
    def setUp(self):
        class OneToOneSourceSerializer(serializers.ModelSerializer):
            class Meta:
                model = OneToOneSource
                fields = ('id', 'name')
      target = models.OneToOneField(OneToOneTarget, related_name='source')
  
  
class ReverseNestedOneToOneTests(TestCase):
    def setUp(self):
        class OneToOneSourceSerializer(serializers.ModelSerializer):
            class Meta:
                model = OneToOneSource
                fields = ('id', 'name')
  
          class OneToOneTargetSerializer(serializers.ModelSerializer):
              source = OneToOneSourceSerializer()
  
keep keep add keep keep keep keep
 Cleanup one-one nested tests and implementation 
rest_framework/tests/relations_nested.py