diff --git a/django/contrib/auth/tests/test_forms.py b/django/contrib/auth/tests/test_forms.py
index 0efd5fb..f6876b1 100644
a
|
b
|
|
| 1 | # coding=utf-8 |
1 | 2 | from __future__ import unicode_literals |
2 | 3 | |
3 | 4 | import os |
… |
… |
class UserCreationFormTest(TestCase):
|
48 | 49 | self.assertEqual(form["username"].errors, |
49 | 50 | [force_text(form.fields['username'].error_messages['invalid'])]) |
50 | 51 | |
| 52 | def test_invalid_non_ascii_username(self): |
| 53 | data = { |
| 54 | 'username': 'jsmithé', |
| 55 | 'password1': 'test123', |
| 56 | 'password2': 'test123', |
| 57 | } |
| 58 | form = UserCreationForm(data) |
| 59 | self.assertFalse(form.is_valid()) |
| 60 | #print(form.fields['username'].error_messages) |
| 61 | self.assertEqual(form["username"].errors, |
| 62 | [force_text(form.fields['username'].error_messages['invalid'])]) |
| 63 | |
51 | 64 | def test_password_verification(self): |
52 | 65 | # The verification password is incorrect. |
53 | 66 | data = { |
diff --git a/django/core/validators.py b/django/core/validators.py
index cc71b72..2d4fd85 100644
a
|
b
|
class RegexValidator(object):
|
46 | 46 | Validates that the input matches the regular expression |
47 | 47 | if inverse_match is False, otherwise raises ValidationError. |
48 | 48 | """ |
| 49 | print(self.regex.pattern, self.regex.flags) |
49 | 50 | if not (self.inverse_match is not bool(self.regex.search( |
50 | 51 | force_text(value)))): |
51 | 52 | raise ValidationError(self.message, code=self.code) |