Ticket #17867: 17867.2.diff
File 17867.2.diff, 1.7 KB (added by , 13 years ago) |
---|
-
django/core/validators.py
160 160 r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*" # dot-atom 161 161 # quoted-string, see also http://tools.ietf.org/html/rfc2822#section-3.2.5 162 162 r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"' 163 r')@((?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+ [A-Z]{2,6}\.?$)' # domain163 r')@((?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)$)' # domain 164 164 r'|\[(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\]$', re.IGNORECASE) # literal form, ipv4 address (SMTP 4.1.3) 165 165 validate_email = EmailValidator(email_re, _(u'Enter a valid e-mail address.'), 'invalid') 166 166 -
tests/regressiontests/forms/tests/fields.py
538 538 self.assertEqual(u'example@valid-with-hyphens.com', f.clean('example@valid-with-hyphens.com')) 539 539 self.assertRaisesMessage(ValidationError, "[u'Enter a valid e-mail address.']", f.clean, 'example@.com') 540 540 self.assertEqual(u'local@domain.with.idn.xyz\xe4\xf6\xfc\xdfabc.part.com', f.clean('local@domain.with.idn.xyzäöüßabc.part.com')) 541 self.assertEqual(u'mailtest@domain.with.idn.tld.उदाहरण.परीक्षा', f.clean('mailtest@domain.with.idn.tld.उदाहरण.परीक्षा')) 541 542 542 543 def test_email_regexp_for_performance(self): 543 544 f = EmailField()