#NEWLINE# def test_user_cannot_be_anonymous( self ) : #NEWLINE# #INDENT# request = RequestFactory ( ) . get ( '/' ) #NEWLINE# request . user = AnonymousUser ( ) #NEWLINE# view = Mock ( ) #NEWLINE# perm = GroupPermission ( 'SomeRealm' , 'SomePermission' ) #NEWLINE# assert ( not perm . has_permission ( request , view ) )