Django

Code

Ticket #7304: 7304.patch

File 7304.patch, 1.3 kB (added by mk, 4 months ago)
  • a/django/contrib/auth/models.py

    old new  
    358358    def has_perm(self, perm): 
    359359        return False 
    360360 
     361    def has_perms(self, perm_list): 
     362        return False 
     363 
    361364    def has_module_perms(self, module): 
    362365        return False 
    363366 
  • a/tests/regressiontests/auth_backends/tests.py

    old new  
    44    from sets import Set as set     # Python 2.3 fallback 
    55 
    66__test__ = {'API_TESTS': """ 
    7 >>> from django.contrib.auth.models import User, Group, Permission 
     7>>> from django.contrib.auth.models import User, Group, Permission, AnonymousUser 
    88>>> from django.contrib.contenttypes.models import ContentType 
    99 
    1010# No Permissions assigned yet, should return False except for superuser 
     
    6969True 
    7070>>> user.has_perms(['auth.test3', 'auth.test_group']) 
    7171True 
     72 
     73# testing permissions of AnonymousUser 
     74>>> user = AnonymousUser() 
     75>>> user.has_perm('test') 
     76False 
     77>>> user.has_perms(['auth.test2', 'auth.test3']) 
     78False 
    7279"""}