#NEWLINE# def test_has_perm_cache( self ) : #NEWLINE# #INDENT# 'Test where a user object already has a permission cache' #NEWLINE# user = self . create_user ( ) #NEWLINE# demo_cache = Mock ( ) #NEWLINE# setattr ( user , '_perm_cache' , self ) #NEWLINE# backend = CachedModelAuthBackend ( ) #NEWLINE# result = backend . get_all_permissions ( user ) #NEWLINE# self . assertEqual ( result , demo_cache ) #NEWLINE# self . assertFalse ( self . mockcache . get . called )