#NEWLINE# def test_send_post_moderation_signal( self ) : #NEWLINE# #INDENT# 'check if custom_approve_handler function was called when ' #NEWLINE# 'moderation_approve signal was send' #NEWLINE# def custom_post_moderation_handler( sender , instance , status , **kwargs ) : #NEWLINE# #INDENT# instance . description = 'Change description' #NEWLINE# instance . save ( ) #NEWLINE# #UNINDENT# post_moderation . connect ( custom_post_moderation_handler , sender = UserProfile ) #NEWLINE# post_moderation . send ( sender = UserProfile , instance = self . profile , status = MODERATION_STATUS_APPROVED ) #NEWLINE# self . assertEqual ( self . profile . description , 'Change description' )