summaryrefslogtreecommitdiff
path: root/tests/auth_tests/test_models.py
diff options
context:
space:
mode:
authorChristophe Mehay <cmehay@student.42.fr>2018-03-01 15:26:40 +0100
committerTim Graham <timograham@gmail.com>2018-03-02 11:32:53 -0500
commit40bac28faabbacd0875e59455cd80fb1dbb16966 (patch)
treeb21e394a71aab4f70fbe3141a37dda938ecf8973 /tests/auth_tests/test_models.py
parenta2e97abd8149e78071806a52282a24c27fe8236b (diff)
Fixed #29176 -- Fixed AbstractBaseUser.normalize_username() crash if username isn't a string.
Diffstat (limited to 'tests/auth_tests/test_models.py')
-rw-r--r--tests/auth_tests/test_models.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auth_tests/test_models.py b/tests/auth_tests/test_models.py
index 32b6d2072b..9438ed8aff 100644
--- a/tests/auth_tests/test_models.py
+++ b/tests/auth_tests/test_models.py
@@ -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