def test_charset_utf8(self): mail_file = pkg_resources.resource_filename('test.unit.fixtures', 'mail.utf8') with open(mail_file) as utf8_mail: mail = message_from_file(utf8_mail) input_mail = InputMail.from_python_mail(mail) body = u'utf8 é çñ\n' self.assertEqual(body, input_mail.body)
def test_charset_latin1(self): mail_file = pkg_resources.resource_filename('test.unit.fixtures', 'mail.latin1') with open(mail_file) as latin1_mail: mail = message_from_file(latin1_mail) input_mail = InputMail.from_python_mail(mail) body = u'latin1 é çñ\n' self.assertEqual(body, input_mail.body)
def _get_welcome_mail(self): current_path = os.path.dirname(os.path.abspath(__file__)) with open( os.path.join(current_path, '..', '..', 'pixelated', 'assets', 'welcome.mail')) as mail_template_file: mail_template = message_from_file(mail_template_file) return InputMail.from_python_mail(mail_template)
def add_welcome_mail(mail_store): current_path = os.path.dirname(os.path.abspath(__file__)) welcome_mail = os.path.join(current_path, 'assets', 'welcome.mail') with open(welcome_mail) as mail_template_file: mail_template = message_from_file(mail_template_file) input_mail = InputMail.from_python_mail(mail_template) mail_store.add_mail('INBOX', input_mail.raw)
def add_welcome_mail(mail_store): welcome_mail = pkg_resources.resource_filename('pixelated.assets', 'welcome.mail') with open(welcome_mail) as mail_template_file: mail_template = message_from_file(mail_template_file) input_mail = InputMail.from_python_mail(mail_template) mail_store.add_mail('INBOX', input_mail.raw)
def add_welcome_mail(mail_store): current_path = os.path.dirname(os.path.abspath(__file__)) welcome_mail = os.path.join(current_path, "assets", "welcome.mail") with open(welcome_mail) as mail_template_file: mail_template = message_from_file(mail_template_file) input_mail = InputMail.from_python_mail(mail_template) mail_store.add_mail("INBOX", input_mail.raw)
def add_welcome_mail(mail_store): current_path = os.path.dirname(os.path.abspath(__file__)) with open(os.path.join(current_path, '..', 'assets', 'welcome.mail')) as mail_template_file: mail_template = message_from_file(mail_template_file) input_mail = InputMail.from_python_mail(mail_template) logging.getLogger('pixelated.config.leap').info('Adding the welcome mail') mail_store.add_mail('INBOX', input_mail.raw)
def _get_welcome_mail(self): current_path = os.path.dirname(os.path.abspath(__file__)) with open(os.path.join(current_path, '..', '..', 'pixelated', 'assets', 'welcome.mail')) as mail_template_file: mail_template = message_from_file(mail_template_file) return InputMail.from_python_mail(mail_template)