Improved tests
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user