Code

Ticket #6174: anonymoususer.diff

File anonymoususer.diff, 988 bytes (added by SmileyChris, 6 years ago)
Line 
1Index: django/contrib/auth/tests.py
2===================================================================
3--- django/contrib/auth/tests.py        (revision 6894)
4+++ django/contrib/auth/tests.py        (working copy)
5@@ -16,9 +16,21 @@
6 >>> u2 = User.objects.create_user('testuser2', 'test2@example.com')
7 >>> u2.has_usable_password()
8 False
9+
10+>>> u.is_authenticated()
11+True
12+>>> u.is_staff
13+False
14+>>> u.is_active
15+True
16+
17 >>> a = AnonymousUser()
18+>>> a.is_authenticated()
19+False
20 >>> a.is_staff
21 False
22+>>> a.is_active
23+False
24 >>> a.groups.all()
25 []
26 >>> a.user_permissions.all()
27Index: django/contrib/auth/models.py
28===================================================================
29--- django/contrib/auth/models.py       (revision 6894)
30+++ django/contrib/auth/models.py       (working copy)
31@@ -322,7 +322,7 @@
32     id = None
33     username = ''
34     is_staff = False
35-    is_active = True
36+    is_active = False
37     is_superuser = False
38     _groups = EmptyManager()
39     _user_permissions = EmptyManager()