#NEWLINE# def test_with_votes( self ) : #NEWLINE# #INDENT# a = AnswerFactory ( ) #NEWLINE# AnswerVoteFactory ( answer = a , helpful = True ) #NEWLINE# AnswerVoteFactory ( answer = a , helpful = True ) #NEWLINE# AnswerVoteFactory ( answer = a , helpful = False ) #NEWLINE# AnswerVoteFactory ( ) #NEWLINE# serializer = api . AnswerSerializer ( instance = a ) #NEWLINE# eq_ ( serializer . data [ 'num_helpful_votes' ] , 2 ) #NEWLINE# eq_ ( serializer . data [ 'num_unhelpful_votes' ] , 1 )