Ticket #17867: 17867.2.diff

File 17867.2.diff, 1.7 KB (added by Pierre <pierre.matri@…>, 12 years ago)

Working diff file. Previous one was broken.

  • django/core/validators.py

     
    160160    r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*"  # dot-atom
    161161    # quoted-string, see also http://tools.ietf.org/html/rfc2822#section-3.2.5
    162162    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}\.?$)'  # domain
     163    r')@((?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)$)'  # domain
    164164    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)
    165165validate_email = EmailValidator(email_re, _(u'Enter a valid e-mail address.'), 'invalid')
    166166
  • tests/regressiontests/forms/tests/fields.py

     
    538538        self.assertEqual(u'example@valid-with-hyphens.com', f.clean('example@valid-with-hyphens.com'))
    539539        self.assertRaisesMessage(ValidationError, "[u'Enter a valid e-mail address.']", f.clean, 'example@.com')
    540540        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.उदाहरण.परीक्षा'))
    541542
    542543    def test_email_regexp_for_performance(self):
    543544        f = EmailField()
Back to Top