#NEWLINE# def test_email_backend_with_https( self ) : #NEWLINE# #INDENT# 'Send email via EmailBackend with secure=True' #NEWLINE# mail . outbox = [ ] #NEWLINE# self . backend . send_login_code ( self . code , secure = True , host = 'secure.example.com' ) #NEWLINE# self . assertEqual ( 1 , len ( mail . outbox ) ) #NEWLINE# message = mail . outbox [ 0 ] #NEWLINE# https_url = self . code . login_url ( secure = True , host = 'secure.example.com' ) #NEWLINE# self . assertTrue ( https_url . startswith ( 'https:' ) ) #NEWLINE# self . assertIn ( https_url , message . body )