#NEWLINE# def test_django_message_send( django_email_backend ) : #NEWLINE# #INDENT# message_params = { #NEWLINE# #INDENT# 'html' : '<p>Test from python-emails' , #NEWLINE# 'mail_from' : 's@lavr.me' , #NEWLINE# 'subject' : 'Test from python-emails' , #NEWLINE# #UNINDENT# } #NEWLINE# msg = DjangoMessage ( ** message_params ) #NEWLINE# assert ( not msg . recipients ( ) ) #NEWLINE# TO = 'ivan@petrov.com' #NEWLINE# msg . send ( mail_to = TO , set_mail_to = False ) #NEWLINE# assert ( msg . recipients ( ) == [ TO ] ) #NEWLINE# assert ( not msg . mail_to ) #NEWLINE# TO = ( 'x' + TO ) #NEWLINE# msg . send ( mail_to = TO ) #NEWLINE# assert ( msg . recipients ( ) == [ TO ] ) #NEWLINE# assert ( msg . mail_to [ 0 ] [ 1 ] == TO ) #NEWLINE# msg . send ( context = { #NEWLINE# #INDENT# 'a' : 1 , #NEWLINE# #UNINDENT# } )