mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Moved AnonymousUser tests to its own test case.
This commit is contained in:
parent
2b5a511bd9
commit
7fce4dc5ff
2 changed files with 20 additions and 16 deletions
|
@ -62,20 +62,6 @@ class BasicTestCase(TestCase):
|
|||
u3 = User.objects.create_user('testuser3', email=None)
|
||||
self.assertEqual(u3.email, '')
|
||||
|
||||
def test_anonymous_user(self):
|
||||
"Check the properties of the anonymous user"
|
||||
a = AnonymousUser()
|
||||
self.assertIsNone(a.pk)
|
||||
self.assertEqual(a.username, '')
|
||||
self.assertEqual(a.get_username(), '')
|
||||
self.assertTrue(a.is_anonymous)
|
||||
self.assertFalse(a.is_authenticated)
|
||||
self.assertFalse(a.is_staff)
|
||||
self.assertFalse(a.is_active)
|
||||
self.assertFalse(a.is_superuser)
|
||||
self.assertEqual(a.groups.all().count(), 0)
|
||||
self.assertEqual(a.user_permissions.all().count(), 0)
|
||||
|
||||
def test_superuser(self):
|
||||
"Check the creation and properties of a superuser"
|
||||
super = User.objects.create_superuser('super', 'super@example.com', 'super')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue