Fixed #18093 -- Added a pk to AnonymousUser.

This commit is contained in:
Aymeric Augustin 2012-05-10 21:42:13 +02:00
parent c970bcf368
commit b1155adcde
2 changed files with 2 additions and 0 deletions

View File

@ -404,6 +404,7 @@ class User(models.Model):
class AnonymousUser(object):
id = None
pk = None
username = ''
is_staff = False
is_active = False

View File

@ -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)