Ejemplo n.º 1
0
    def test_from_header_from_address_not_a_user(self):
        context = MagicMock()
        context.acl_users.get_userByEmail.return_value = None
        ms = MessageSender(context, MagicMock())

        with self.assertRaises(ValueError):
            ms.from_header_from_address('*****@*****.**')
Ejemplo n.º 2
0
    def test_from_header_from_address_not_a_user(self):
        context = MagicMock()
        context.acl_users.get_userByEmail.return_value = None
        ms = MessageSender(context, MagicMock())

        with self.assertRaises(ValueError):
            ms.from_header_from_address('*****@*****.**')
Ejemplo n.º 3
0
    def test_from_header_from_address_user(self, m_IGSUI):
        context = MagicMock()
        m_IGSUI().name = 'Example person'
        ms = MessageSender(context, MagicMock())
        r = ms.from_header_from_address('*****@*****.**')

        self.assertEqual('Example person <*****@*****.**>', r)
Ejemplo n.º 4
0
    def test_from_header_from_address_user(self, m_IGSUI):
        context = MagicMock()
        m_IGSUI().name = 'Example person'
        ms = MessageSender(context, MagicMock())
        r = ms.from_header_from_address('*****@*****.**')

        self.assertEqual('Example person <*****@*****.**>', r)
Ejemplo n.º 5
0
    def test_from_header_from_address_none(self, m_sI):
        m_sI().name = 'Example'
        m_sI().get_support_email.return_value = '*****@*****.**'
        context = MagicMock()
        ms = MessageSender(context, MagicMock())
        r = ms.from_header_from_address(None)

        self.assertEqual('Example Support <*****@*****.**>', r)
Ejemplo n.º 6
0
    def test_from_header_from_address_none(self, m_sI):
        m_sI().name = 'Example'
        m_sI().get_support_email.return_value = '*****@*****.**'
        context = MagicMock()
        ms = MessageSender(context, MagicMock())
        r = ms.from_header_from_address(None)

        self.assertEqual('Example Support <*****@*****.**>', r)