#NEWLINE# def test_helpfulness( self ) : #NEWLINE# #INDENT# u = UserFactory ( ) #NEWLINE# p = u . profile #NEWLINE# a1 = AnswerFactory ( creator = u ) #NEWLINE# a2 = AnswerFactory ( creator = u ) #NEWLINE# AnswerVoteFactory ( answer = a1 , helpful = True ) #NEWLINE# AnswerVoteFactory ( answer = a2 , helpful = True ) #NEWLINE# AnswerVoteFactory ( answer = a2 , helpful = True ) #NEWLINE# AnswerVoteFactory ( creator = u ) #NEWLINE# AnswerVoteFactory ( answer = a1 , helpful = False ) #NEWLINE# serializer = api . ProfileSerializer ( instance = p ) #NEWLINE# eq_ ( serializer . data [ 'helpfulness' ] , 3 )