#NEWLINE# def test_register_acl_set( self , guards_engine_mock ) : #NEWLINE# #INDENT# DummyView = self . _dummy_view ( ) #NEWLINE# view = DummyView ( ) #NEWLINE# view . Model . __name__ = 'Foo' #NEWLINE# resource = Mock ( ) #NEWLINE# view . request . registry . _model_collections [ 'Foo' ] = resource #NEWLINE# view . request . _user . _acl = [ ] #NEWLINE# assert ( view . register ( ) == 1 ) #NEWLINE# factory = resource . view . _factory #NEWLINE# factory . assert_called_once_with ( view . request ) #NEWLINE# factory ( ) . generate_item_acl . assert_called_once_with ( view . request . _user ) #NEWLINE# guards_engine_mock . ACLField . stringify_acl . assert_called_once_with ( factory ( ) . generate_item_acl ( ) ) #NEWLINE# view . request . _user . update . assert_called_once_with ( { #NEWLINE# #INDENT# '_acl' : guards_engine_mock . ACLField . stringify_acl ( ) , #NEWLINE# #UNINDENT# } )