Esempio n. 1
0
    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)
Esempio n. 2
0
    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)
Esempio n. 3
0
 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
Esempio n. 4
0
 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