Django

Code

Ticket #6174: anonymoususer.diff

File anonymoususer.diff, 1.0 kB (added by SmileyChris, 1 year ago)
  • django/contrib/auth/tests.py

    old new  
    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

    old new  
    322322    id = None 
    323323    username = '' 
    324324    is_staff = False 
    325     is_active = Tru
     325    is_active = Fals
    326326    is_superuser = False 
    327327    _groups = EmptyManager() 
    328328    _user_permissions = EmptyManager()