#NEWLINE# def test_notify_comment_followers( self ) : #NEWLINE# #INDENT# self . assertEqual ( self . mock_mailer . call_count , 1 ) #NEWLINE# self . get_confirm_comment_url ( self . key ) #NEWLINE# self . assertEqual ( self . mock_mailer . call_count , 1 ) #NEWLINE# self . form = django_comments . get_form ( ) ( self . article ) #NEWLINE# data = { #NEWLINE# #INDENT# 'name' : 'Alice' , #NEWLINE# 'email' : 'alice@example.com' , #NEWLINE# 'followup' : True , #NEWLINE# 'reply_to' : 0 , #NEWLINE# 'level' : 1 , #NEWLINE# 'order' : 1 , #NEWLINE# 'comment' : 'Es war einmal eine kleine...' , #NEWLINE# #UNINDENT# } #NEWLINE# data . update ( self . form . initial ) #NEWLINE# self . response = self . client . post ( reverse ( 'comments-post-comment' ) , data = data ) #NEWLINE# self . assertEqual ( self . mock_mailer . call_count , 2 ) #NEWLINE# self . key = re . search ( 'http://.+/confirm/(?P<key>[\\S]+)' , self . mock_mailer . call_args [ 0 ] [ 1 ] ) . group ( 'key' ) #NEWLINE# self . get_confirm_comment_url ( self . key ) #NEWLINE# self . assertEqual ( self . mock_mailer . call_count , 3 ) #NEWLINE# self . assert_ ( ( self . mock_mailer . call_args [ 0 ] [ 3 ] == [ 'bob@example.com' ] ) ) #NEWLINE# self . assert_ ( ( self . mock_mailer . call_args [ 0 ] [ 1 ] . find ( 'There is a new comment following up yours.' ) > ( - 1 ) ) )