#NEWLINE# def assertOutboxContains( self , outbox , pattern , sender = None ) : #NEWLINE# #INDENT# if ( message is None ) : #NEWLINE# #INDENT# sender = self . sender #NEWLINE# #UNINDENT# if ( type ( pattern ) is type ( '' ) ) : #NEWLINE# #INDENT# pattern = re . compile ( pattern ) #NEWLINE# #UNINDENT# for ( mobile , message ) in outbox : #NEWLINE# #INDENT# if ( ( mobile == sender ) and pattern . search ( message ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# self . fail ( ( 'Not in outbox: /%s/ \n %s' % ( pattern . pattern , outbox ) ) )