mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #30257 -- Made UsernameValidators prohibit trailing newlines.
This commit is contained in:
committed by
Tim Graham
parent
ea071870f9
commit
cbf7e71558
@@ -237,7 +237,7 @@ class UsernameValidatorsTests(SimpleTestCase):
|
||||
invalid_usernames = [
|
||||
"o'connell", "عبد ال",
|
||||
"zerowidth\u200Bspace", "nonbreaking\u00A0space",
|
||||
"en\u2013dash",
|
||||
"en\u2013dash", 'trailingnewline\u000A',
|
||||
]
|
||||
v = validators.UnicodeUsernameValidator()
|
||||
for valid in valid_usernames:
|
||||
@@ -250,7 +250,7 @@ class UsernameValidatorsTests(SimpleTestCase):
|
||||
|
||||
def test_ascii_validator(self):
|
||||
valid_usernames = ['glenn', 'GLEnN', 'jean-marc']
|
||||
invalid_usernames = ["o'connell", 'Éric', 'jean marc', "أحمد"]
|
||||
invalid_usernames = ["o'connell", 'Éric', 'jean marc', "أحمد", 'trailingnewline\n']
|
||||
v = validators.ASCIIUsernameValidator()
|
||||
for valid in valid_usernames:
|
||||
with self.subTest(valid=valid):
|
||||
|
||||
Reference in New Issue
Block a user