mirror of
https://github.com/django/django.git
synced 2025-06-06 20:19:13 +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):
|
class AnonymousUser(object):
|
||||||
id = None
|
id = None
|
||||||
|
pk = None
|
||||||
username = ''
|
username = ''
|
||||||
is_staff = False
|
is_staff = False
|
||||||
is_active = False
|
is_active = False
|
||||||
|
@ -52,6 +52,7 @@ class BasicTestCase(TestCase):
|
|||||||
def test_anonymous_user(self):
|
def test_anonymous_user(self):
|
||||||
"Check the properties of the anonymous user"
|
"Check the properties of the anonymous user"
|
||||||
a = AnonymousUser()
|
a = AnonymousUser()
|
||||||
|
self.assertEqual(a.pk, None)
|
||||||
self.assertFalse(a.is_authenticated())
|
self.assertFalse(a.is_authenticated())
|
||||||
self.assertFalse(a.is_staff)
|
self.assertFalse(a.is_staff)
|
||||||
self.assertFalse(a.is_active)
|
self.assertFalse(a.is_active)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user