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')
def test_invalid_domain(self): with self.assertRaisesRegex(ValueError, '^Invalid domain: example.com$'): validate_email('user@example com')
def test_i18n(self): self.assertEqual(validate_email('user@exämple.com'), '*****@*****.**')
def test_basic(self): self.assertEqual(validate_email('*****@*****.**'), '*****@*****.**')