#NEWLINE# def _send_test_messages( request , domain , config_id , actually ) : #NEWLINE# #INDENT# performance_config = PerformanceConfiguration . get ( config_id ) #NEWLINE# assert ( performance_config . domain == domain ) #NEWLINE# sent_messages = send_messages_for_config ( performance_config , actually_send = actually ) #NEWLINE# heading = ( _ ( 'The following messages have been sent' ) if actually else _ ( 'Would send the following messages' ) ) #NEWLINE# if sent_messages : #NEWLINE# #INDENT# messages . success ( request , mark_safe ( _ ( '{}: <br>{}' ) . format ( heading , '<br>' . join ( [ ' - {} (to {} via {})' . format ( result . message , result . user . raw_username , result . user . phone_number ) for result in sent_messages ] ) ) ) , extra_tags = 'html' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# messages . info ( request , _ ( 'Unfortunately, here were no valid recipients for this message.' ) ) #NEWLINE# #UNINDENT# return HttpResponseRedirect ( reverse ( 'performance_sms.list_performance_configs' , args = [ performance_config ] ) )