#NEWLINE# @ override_settings ( EMAIL_BACKEND = 'djmail.backends.default.EmailBackend' , DJMAIL_REAL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend' ) #NEWLINE# def test_simple_send_email_with_magic_builder_1_with_low_priority( self ) : #NEWLINE# #INDENT# mails = MagicMailBuilder ( ) #NEWLINE# email = mails . test_email2 ( 'to@example.com' , { #NEWLINE# #INDENT# 'name' : 'foo' , #NEWLINE# #UNINDENT# } , priority = 10 ) #NEWLINE# email . send ( ) #NEWLINE# self . assertEqual ( len ( mail . outbox ) , 0 ) #NEWLINE# self . assertEqual ( models . Message . objects . count ( ) , 1 ) #NEWLINE# m1 = models . Message . objects . get ( ) #NEWLINE# self . assertEqual ( m1 . status , models . STATUS_PENDING ) #NEWLINE# self . assertEqual ( m1 . priority , 10 ) #NEWLINE# core . _send_pending_messages ( ) #NEWLINE# self . assertEqual ( len ( mail . outbox ) , 1 ) #NEWLINE# self . assertEqual ( models . Message . objects . count ( ) , 1 ) #NEWLINE# m2 = models . Message . objects . get ( ) #NEWLINE# self . assertEqual ( m2 . status , models . STATUS_SENT ) #NEWLINE# self . assertEqual ( m2 . priority , 10 )