      def __eq__(self, other):
          return all([getattr(self, attr) == getattr(other, attr)
                      for attr in ('email', 'content', 'created')])
  
  
  class CommentSerializer(serializers.Serializer):
      email = serializers.EmailField()
      content = serializers.CharField(max_length=1000)
 
</s> remove 
 </s> add     sub_comment = serializers.Field(source='get_sub_comment.sub_comment')
     </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) </s> remove             'created': None
 </s> add             'created': None,
            'sub_comment': ''
                    
    def get_sub_comment(self):
        sub_comment = SubComment('And Merry Christmas!')
        return sub_comment
      def __eq__(self, other):
          return all([getattr(self, attr) == getattr(other, attr)
                      for attr in ('email', 'content', 'created')])
                    
    def get_sub_comment(self):
        sub_comment = SubComment('And Merry Christmas!')
        return sub_comment
  
  
  class CommentSerializer(serializers.Serializer):
      email = serializers.EmailField()
      content = serializers.CharField(max_length=1000)
keep keep add keep keep keep keep keep
 Added tests for dotted notation in serializer field source 
rest_framework/tests/serializer.py