def testMailBuildToSendMethodMustReturnTheStringThatCanBeSentByTheMailService(self): mail = Mail() mail.id = self.id mail.recipient = self.recipient mail.subject = self.subject mail.body = self.body sendable_string = mail.build_to_send_from_host(self.email_host_user) self.assertEquals(self.expected_result, sendable_string)
def testMailBuildToSendMethodMustReturnTheStringThatCanBeSentByTheMailService( self): mail = Mail() mail.id = self.id mail.recipient = self.recipient mail.subject = self.subject mail.body = self.body sendable_string = mail.build_to_send_from_host(self.email_host_user) self.assertEquals(self.expected_result, sendable_string)
def get_mails_list(self): self.log.debug("parsing: %s", self.json) mails_data_list = json.loads(self.json)['results'] mails_list = [] for mail_data in mails_data_list: #self.log("Processing mail data: %s", mail_data) mail = Mail() mail.id = mail_data['id'] mail.recipient = mail_data['recipient'] mail.subject = mail_data['subject'] mail.body = mail_data['body'] mails_list.append(mail) return mails_list
def get_mails_list(self): self.log.debug("parsing: %s", self.json) mails_data_list = json.loads(self.json)["results"] mails_list = [] for mail_data in mails_data_list: # self.log("Processing mail data: %s", mail_data) mail = Mail() mail.id = mail_data["id"] mail.recipient = mail_data["recipient"] mail.subject = mail_data["subject"] mail.body = mail_data["body"] mails_list.append(mail) return mails_list