#NEWLINE# def test_submission_sends_email( self ) : #NEWLINE# #INDENT# 'Test if the submitted form results in email sent.' #NEWLINE# data = { #NEWLINE# #INDENT# 'recaptcha_response_field' : 'PASSED' , #NEWLINE# 'contact_name' : 'Harry Potter' , #NEWLINE# 'contact_email' : 'harry@potter.com' , #NEWLINE# 'self_organized' : True , #NEWLINE# 'url' : 'http://example.org/2016-02-13-Hogwart' , #NEWLINE# 'notes' : '' , #NEWLINE# #UNINDENT# } #NEWLINE# rv = self . client . post ( reverse ( 'event_submit' ) , data , follow = True ) #NEWLINE# self . assertEqual ( rv . status_code , 200 ) #NEWLINE# self . assertNotIn ( 'form' , rv . context ) #NEWLINE# self . assertEqual ( len ( mail . outbox ) , 1 ) #NEWLINE# msg = mail . outbox [ 0 ] #NEWLINE# self . assertEqual ( msg . subject , 'New workshop submission from Harry Potter' )