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('*****@*****.**')
    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('*****@*****.**')
    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)
    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)
    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)
    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)