  class CommentSerializer(serializers.Serializer):
      email = serializers.EmailField()
      content = serializers.CharField(max_length=1000)
      created = serializers.DateTimeField()
  
      def restore_object(self, data, instance=None):
          if instance is None:
              return Comment(**data)
          for key, val in data.items():
              setattr(instance, key, val)
 
</s> remove         serializer = CommentSerializer(instance=self.comment)
        expected = self.data
        self.assertEquals(serializer.data, expected)
 </s> add         serializer = CommentSerializer(instance=self.comment)        
        self.assertEquals(serializer.data, self.expected)
    sub_comment = serializers.Field(source='get_sub_comment.sub_comment')
    
  class CommentSerializer(serializers.Serializer):
      email = serializers.EmailField()
      content = serializers.CharField(max_length=1000)
      created = serializers.DateTimeField()
    sub_comment = serializers.Field(source='get_sub_comment.sub_comment')
    
      def restore_object(self, data, instance=None):
          if instance is None:
              return Comment(**data)
          for key, val in data.items():
              setattr(instance, key, val)
keep keep keep keep replace keep keep keep keep keep
 Added tests for dotted notation in serializer field source 
rest_framework/tests/serializer.py