#NEWLINE# def test_email_hook_filters_events_by_user_and_event_type( self ) : #NEWLINE# #INDENT# email_hook = logging_models . EmailHook . objects . create ( user = self . owner , email = email_hook . owner . email , event_types = [ self . event_type ] ) #NEWLINE# process_event ( self . event ) #NEWLINE# self . assertEqual ( len ( mail . outbox ) , 1 ) #NEWLINE# self . assertEqual ( mail . outbox [ 0 ] . to , [ email_hook . email ] )