#NEWLINE# @ T . setup_teardown #NEWLINE# def mock_smtp( self ) : #NEWLINE# #INDENT# with mock . patch . object ( pushmanager . core . mail . MailQueue , 'smtp' ) as mocked_smtp : #NEWLINE# #INDENT# with mock . patch . object ( pushmanager . core . mail . MailQueue , 'message_queue' ) : #NEWLINE# #INDENT# self . mocked_smtp = mocked_smtp #NEWLINE# self . MockedSettings = copy . deepcopy ( Settings ) #NEWLINE# ( yield )