def test_send_mail_with_attach(self): subject = 'Test subject 2' attach_html = attach_html_wrapper( '<p class="test">Attach html doc</p>', title='Test html attach', head='<style>.test {font-size: 20px;}</style>' ) send_mail(subject, 'body 2 ...', '*****@*****.**', attach_alternative=(('<p>body 2 ...</p>', 'text/html'),), attaches=(('file.txt', attach_html, 'text/html'),)) self.assertEqual(len(mail.outbox), 1) self.assertEqual(mail.outbox[0].subject, settings.EMAIL_SUBJECT_PREFIX + subject)
def test_send_mail_with_attach(self): subject = 'Test subject 2' attach_html = attach_html_wrapper( '<p class="test">Attach html doc</p>', title='Test html attach', head='<style>.test {font-size: 20px;}</style>') send_mail(subject, 'body 2 ...', '*****@*****.**', attach_alternative=(('<p>body 2 ...</p>', 'text/html'), ), attaches=(('file.txt', attach_html, 'text/html'), )) self.assertEqual(len(mail.outbox), 1) self.assertEqual(mail.outbox[0].subject, settings.EMAIL_SUBJECT_PREFIX + subject)
def test_send_mail_simple(self): subject = 'Test subject' send_mail(subject, 'body 1 ...', '*****@*****.**') self.assertEqual(len(mail.outbox), 1) self.assertEqual(mail.outbox[0].subject, settings.EMAIL_SUBJECT_PREFIX + subject)