#NEWLINE# def test_dislike_liked_comment_undoes_like_and_incerements_comment_dislikes_logged_in_user( self ) : #NEWLINE# #INDENT# self . client . login ( email = 'a@b.com' , password = 'pass' ) #NEWLINE# self . client . post ( reverse ( 'comments:like_comment' , kwargs = { #NEWLINE# #INDENT# 'comment_id' : self . test_comment . id , #NEWLINE# #UNINDENT# } ) , data = { #NEWLINE# #INDENT# 'domain' : self . test_site . domain , #NEWLINE# #UNINDENT# } ) #NEWLINE# comment = Comment . objects . get ( id = self . test_comment . id ) #NEWLINE# self . assertEqual ( comment . likes_count , 1 ) #NEWLINE# self . client . post ( reverse ( 'comments:dislike_comment' , kwargs = { #NEWLINE# #INDENT# 'comment_id' : self . test_comment . id , #NEWLINE# #UNINDENT# } ) , data = { #NEWLINE# #INDENT# 'domain' : self . test_site . domain , #NEWLINE# #UNINDENT# } ) #NEWLINE# comment = Comment . objects . get ( id = self . test_comment . id ) #NEWLINE# self . assertEqual ( comment . likes_count , 0 ) #NEWLINE# self . assertEqual ( comment . dislikes_count , 1 )