#NEWLINE# def test_send_scheduled_messages( self ) : #NEWLINE# #INDENT# schedule_messages ( TestMessagePlainDynamic ( 'my_dyn_msg' ) , recipients ( 'test_messenger' , ( 'three' , 'four' ) ) ) #NEWLINE# msgr = get_registered_messenger_object ( 'test_messenger' ) #NEWLINE# msg = TestMessagePlain ( 'my_message' ) #NEWLINE# schedule_messages ( msg , recipients ( msgr , ( 'one' , 'two' ) ) ) #NEWLINE# send_scheduled_messages ( priority = TestMessagePlain . priority ) #NEWLINE# self . assertEqual ( len ( msgr . last_send [ 'dispatch_models' ] ) , 2 ) #NEWLINE# self . assertEqual ( msgr . last_send [ 'message_model' ] . cls , 'testplain' ) #NEWLINE# self . assertEqual ( msgr . last_send [ 'message_cls' ] , TestMessagePlain ) #NEWLINE# self . assertEqual ( msgr . last_send [ 'dispatch_models' ] [ 0 ] . message_cache , 'my_message' ) #NEWLINE# self . assertEqual ( msgr . last_send [ 'dispatch_models' ] [ 1 ] . message_cache , 'my_message' )