Improved tests

This commit is contained in:
2026-05-28 10:42:23 +02:00
parent d417d88d1e
commit efd2305b35
9 changed files with 66 additions and 34 deletions
+4 -2
View File
@@ -5,7 +5,8 @@ from django.test import TestCase, Client
class ModelsTestCase(TestCase):
@skip('I do not know, why the user.save() does not raise an exception')
@skip('user.save() should raise an ValidationError when the user name is to long.'
' But it does not. I do not know why.')
def test_username_length(self):
max_length = 150 # Hard coded in django.contrib.auth.models.AbstractUser
username_ok = 'u' * max_length
@@ -16,7 +17,8 @@ class ModelsTestCase(TestCase):
first_name='A',
last_name='User',
email='a.user@example.com')
user.save()
with self.assertRaises(Exception):
user.save()
def test_last_login(self):
user_model = get_user_model()