mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Fixed #18093 -- Added a pk to AnonymousUser.
This commit is contained in:
parent
c970bcf368
commit
b1155adcde
@ -404,6 +404,7 @@ class User(models.Model):
|
||||
|
||||
class AnonymousUser(object):
|
||||
id = None
|
||||
pk = None
|
||||
username = ''
|
||||
is_staff = False
|
||||
is_active = False
|
||||
|
@ -52,6 +52,7 @@ class BasicTestCase(TestCase):
|
||||
def test_anonymous_user(self):
|
||||
"Check the properties of the anonymous user"
|
||||
a = AnonymousUser()
|
||||
self.assertEqual(a.pk, None)
|
||||
self.assertFalse(a.is_authenticated())
|
||||
self.assertFalse(a.is_staff)
|
||||
self.assertFalse(a.is_active)
|
||||
|
Loading…
Reference in New Issue
Block a user