mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Fixed #29176 -- Fixed AbstractBaseUser.normalize_username() crash if username isn't a string.
This commit is contained in:
parent
a2e97abd81
commit
40bac28faa
3 changed files with 8 additions and 1 deletions
|
@ -12,6 +12,7 @@ from django.core import mail
|
|||
from django.db.models.signals import post_save
|
||||
from django.test import SimpleTestCase, TestCase, override_settings
|
||||
|
||||
from .models import IntegerUsernameUser
|
||||
from .models.with_custom_email_field import CustomEmailField
|
||||
|
||||
|
||||
|
@ -157,6 +158,9 @@ class UserManagerTestCase(TestCase):
|
|||
|
||||
class AbstractBaseUserTests(TestCase):
|
||||
|
||||
def test_normalize_username(self):
|
||||
self.assertEqual(IntegerUsernameUser().normalize_username(123), 123)
|
||||
|
||||
def test_clean_normalize_username(self):
|
||||
# The normalization happens in AbstractBaseUser.clean()
|
||||
ohm_username = 'iamtheΩ' # U+2126 OHM SIGN
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue