#NEWLINE# def test_email_backend( self ) : #NEWLINE# #INDENT# 'Send email via EmailBackend with default options' #NEWLINE# mail . outbox = [ ] #NEWLINE# self . backend . send_login_code ( self . code ) #NEWLINE# self . assertEqual ( 1 , len ( mail . outbox ) ) #NEWLINE# message = mail . outbox [ 0 ] #NEWLINE# http_url = self . code . login_url ( ) #NEWLINE# self . assertIn ( http_url , message . body ) #NEWLINE# self . assertTrue ( http_url . startswith ( 'http:' ) ) #NEWLINE# self . assertEqual ( [ self . user . email ] , message . to )