Exemplo n.º 1
0
    def test_confusables_email_validator(self):
        """
        Test the confusable-email validator standalone.

        """
        for dangerous_value in (u'p\u0430yp\[email protected]',
                                u'g\u043e\[email protected]',
                                u'\u03c1ay\[email protected]',
                                u'paypal@ex\u0430mple.com',
                                u'google@exam\u03c1le.com'):
            with self.assertRaises(ValidationError):
                validators.validate_confusables_email(dangerous_value)
        for safe_value in (
                u'*****@*****.**',
                u'*****@*****.**',
                u'\u041f\u0451\u0442\[email protected]',
                u'\u5c71\[email protected]',
                u'username',
        ):
            validators.validate_confusables_email(safe_value)
Exemplo n.º 2
0
    def test_confusables_email_validator(self):
        """
        Test the confusable-email validator standalone.

        """
        for dangerous_value in (
                u'p\u0430yp\[email protected]',
                u'g\u043e\[email protected]',
                u'\u03c1ay\[email protected]',
                u'paypal@ex\u0430mple.com',
                u'google@exam\u03c1le.com'
        ):
            with self.assertRaises(ValidationError):
                validators.validate_confusables_email(dangerous_value)
        for safe_value in(
                u'*****@*****.**',
                u'*****@*****.**',
                u'\u041f\u0451\u0442\[email protected]',
                u'\u5c71\[email protected]',
                u'username',
        ):
            validators.validate_confusables_email(safe_value)