Skip to content

Home Information - Your home, your data, organized.

Python
774 B
Raw Blame
import logging

from django.test import TestCase

import hi.apps.common.email_utils as email_utils

logging.disable(logging.CRITICAL)


class EmailUtilsTestCase(TestCase):

    def test_parse_emails_from_text(self):

        text = """
        foo
        bar
        biz, bif  , baz
        [email protected]

        [email protected], [email protected]  ;  [email protected]
 
        """

        expected = [
            'foo',
            'bar',
            'biz',
            'bif',
            'baz',
            '[email protected]',
            '[email protected]',
            '[email protected]',
            '[email protected]',
        ]

        result = email_utils.parse_emails_from_text( text )
        self.assertEqual( expected, result )
        return