parameciofm/tests/sendmailtest.py
2016-07-25 05:34:13 +02:00

22 lines
928 B
Python

from settings import config
from paramecio.citoplasma import sendmail
import time
import unittest
class TestFieldMethods(unittest.TestCase):
def test_sendmail(self):
s=sendmail.SendMail()
self.assertTrue( s.send(config.portal_email, [config.email_test], 'This is a test', 'A message for test a simple email method', content_type='plain', attachments=[]) )
time.sleep(70)
self.assertTrue( s.send(config.portal_email, [config.email_test], 'This is a test', 'A message for test a simple email method in <b>html</b>', content_type='html', attachments=[]) )
time.sleep(70)
self.assertTrue( s.send(config.portal_email, [config.email_test], 'This is a test', 'A message for test a simple email method in <b>html</b> and attachments', content_type='html', attachments=['tests/images/image.jpg']) )
s.quit()