#NEWLINE# def test_send_email( self ) : #NEWLINE# #INDENT# response = webapp2 . Response ( ) #NEWLINE# handler = mail_request_handler . MailRequestHandler ( None , response ) #NEWLINE# message = object ( ) #NEWLINE# self . mox . StubOutWithMock ( response , '_send' ) #NEWLINE# self . mox . StubOutWithMock ( handler , '_generate_email' ) #NEWLINE# handler . _generate_email ( 'to' , 'from' , 'cc' , 'subject' , 'body' ) . AndReturn ( message ) #NEWLINE# handler . _send ( '/_ah/mail/to' , message ) . AndReturn ( dispatcher . ResponseTuple ( '500 Internal Server Error' , [ ] , 'Response' ) ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# handler . _send_email ( 'to' , 'from' , 'cc' , 'subject' , 'body' ) #NEWLINE# self . mox . VerifyAll ( ) #NEWLINE# self . assertEqual ( 500 , response . status_int )