Ticket #6174: anonymoususer.diff

File anonymoususer.diff, 988 bytes (added by SmileyChris, 8 years ago)
  • django/contrib/auth/tests.py

     
    1616>>> u2 = User.objects.create_user('testuser2', 'test2@example.com')
    1717>>> u2.has_usable_password()
    1818False
     19
     20>>> u.is_authenticated()
     21True
     22>>> u.is_staff
     23False
     24>>> u.is_active
     25True
     26
    1927>>> a = AnonymousUser()
     28>>> a.is_authenticated()
     29False
    2030>>> a.is_staff
    2131False
     32>>> a.is_active
     33False
    2234>>> a.groups.all()
    2335[]
    2436>>> a.user_permissions.all()
  • django/contrib/auth/models.py

     
    322322    id = None
    323323    username = ''
    324324    is_staff = False
    325     is_active = True
     325    is_active = False
    326326    is_superuser = False
    327327    _groups = EmptyManager()
    328328    _user_permissions = EmptyManager()
Back to Top