예제 #1
0
파일: test_mongo.py 프로젝트: gukoff/ognom
class TestEmailValidator(unittest.TestCase):
    def setUp(self):
        self.validator = EmailValidator()

    def test_valid_emails(self):
        valid_emails = [
            '[email protected]',
            '"Abc\@def"@example.com',
            '"Fred Bloggs"@example.com',
            '"Joe\\Blow"@example.com',
            '"Abc@def"@example.com',
            'customer/[email protected]',
            '\[email protected]',
            '!def!xyz%[email protected]',
            '*****@*****.**',
            '*****@*****.**',
            'mimimi@президент.рф'
        ]
        for email in valid_emails:
            assert self.validator.validate(email)

    def test_invalid_emails(self):
        invalid_emails = ['email.r', '&&&abir@valg']
        for email in invalid_emails:
            assert not self.validator.validate(email)
예제 #2
0
class TestEmailValidator(unittest.TestCase):
    def setUp(self):
        self.validator = EmailValidator()

    def test_valid_emails(self):
        valid_emails = [
            '[email protected]', '"Abc\@def"@example.com',
            '"Fred Bloggs"@example.com', '"Joe\\Blow"@example.com',
            '"Abc@def"@example.com',
            'customer/[email protected]', '\[email protected]',
            '!def!xyz%[email protected]', '*****@*****.**',
            '*****@*****.**', 'mimimi@президент.рф'
        ]
        for email in valid_emails:
            assert self.validator.validate(email)

    def test_invalid_emails(self):
        invalid_emails = ['email.r', '&&&abir@valg']
        for email in invalid_emails:
            assert not self.validator.validate(email)
예제 #3
0
 def setUp(self):
     self.validator = EmailValidator()
예제 #4
0
 class TD(BaseDoc):
     field1 = StringField(validators=[EmailValidator()])
예제 #5
0
파일: test_mongo.py 프로젝트: gukoff/ognom
 def setUp(self):
     self.validator = EmailValidator()