예제 #1
0
    def __init__(self, http_serializer=None, auth_user=None, auth_pass=None):
        """
        Constructor
        """
        logger_manager = LoggerManager()
        self.log = logger_manager.get_new_logger("administrator mail")
        self.http_serializer = http_serializer
        self.auth_user = auth_user
        self.auth_pass = auth_pass

        self.json_translator = JSONToMailTranslator()
        self.requests = requests
예제 #2
0
    def testJSONToMailTranstalorMustTakeJSONStringContainingInformationAndReturnAListOfMailEntities(
            self):
        jsonstring = '{"count": 1, "next": null, "previous": null, "results": [{"id": 10, "subject": "Registration SEAL Successful", "body": "You have been registered in SEAL with username: martinmaurozucchiatti and password: 1234", "recipient": "*****@*****.**"}]}'
        translator = JSONToMailTranslator(json_str=jsonstring)

        mails = translator.get_mails_list()

        mail = mails[0]
        self.assertEqual(mail.id, 10)
        self.assertEqual(mail.subject, "Registration SEAL Successful")
        self.assertEqual(mail.recipient, "*****@*****.**")
        self.assertEqual(
            mail.body,
            "You have been registered in SEAL with username: martinmaurozucchiatti and password: 1234"
        )