Пример #1
0
    def test_no_at(self):
        with self.assertRaisesRegex(ValueError,
                                    '^Invalid email address: user$'):
            validate_email('user')

        with self.assertRaisesRegex(ValueError,
                                    '^Invalid email address: example.com$'):
            validate_email('example.com')
Пример #2
0
 def test_invalid_domain(self):
     with self.assertRaisesRegex(ValueError, '^Invalid domain: example.com$'):
         validate_email('user@example com')
Пример #3
0
 def test_i18n(self):
     self.assertEqual(validate_email('user@exämple.com'), '*****@*****.**')
Пример #4
0
 def test_basic(self):
     self.assertEqual(validate_email('*****@*****.**'), '*****@*****.**')