当前位置: 首页>>代码示例>>Python>>正文


Python DummyContent.reset方法代码示例

本文整理汇总了Python中Products.CMFCore.tests.base.dummy.DummyContent.reset方法的典型用法代码示例。如果您正苦于以下问题:Python DummyContent.reset方法的具体用法?Python DummyContent.reset怎么用?Python DummyContent.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Products.CMFCore.tests.base.dummy.DummyContent的用法示例。


在下文中一共展示了DummyContent.reset方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_manageDelObjects

# 需要导入模块: from Products.CMFCore.tests.base.dummy import DummyContent [as 别名]
# 或者: from Products.CMFCore.tests.base.dummy.DummyContent import reset [as 别名]
    def test_manageDelObjects(self):
        test = self._makeOne('test')
        foo = DummyContent('foo')

        test._setObject('foo', foo)
        foo.reset()
        test.manage_delObjects( ids=['foo'] )
        self.failIf( foo.after_add_called )
        self.failUnless( foo.before_delete_called )
开发者ID:goschtl,项目名称:zope,代码行数:11,代码来源:test_PortalFolder.py

示例2: test_manageDelObjects

# 需要导入模块: from Products.CMFCore.tests.base.dummy import DummyContent [as 别名]
# 或者: from Products.CMFCore.tests.base.dummy.DummyContent import reset [as 别名]
    def test_manageDelObjects( self ):

        test = self.root.test
        foo = DummyContent( 'foo' )

        test._setObject( 'foo', foo )
        foo.reset()
        test.manage_delObjects( ids=[ 'foo' ] )
        assert not foo.after_add_called
        assert foo.before_delete_called
开发者ID:goschtl,项目名称:zope,代码行数:12,代码来源:test_PortalFolder.py

示例3: test_manageDelObjects

# 需要导入模块: from Products.CMFCore.tests.base.dummy import DummyContent [as 别名]
# 或者: from Products.CMFCore.tests.base.dummy.DummyContent import reset [as 别名]
    def test_manageDelObjects(self):
        acl_users = self.site._setObject('acl_users', DummyUserFolder())
        newSecurityManager(None, acl_users.all_powerful_Oz)
        test = self._makeOne('test')
        foo = DummyContent('foo')

        test._setObject('foo', foo)
        foo.reset()
        test.manage_delObjects(ids=['foo'])
        self.assertFalse(foo.after_add_called)
        self.assertTrue(foo.before_delete_called)
开发者ID:goschtl,项目名称:zope,代码行数:13,代码来源:test_PortalFolder.py

示例4: test_deletePropagation

# 需要导入模块: from Products.CMFCore.tests.base.dummy import DummyContent [as 别名]
# 或者: from Products.CMFCore.tests.base.dummy.DummyContent import reset [as 别名]
    def test_deletePropagation(self):
        test = self._makeOne('test')
        foo = DummyContent('foo')
        foo.reset()
        self.failIf( foo.after_add_called )
        self.failIf( foo.before_delete_called )

        test._setObject('foo', foo)
        self.failUnless( foo.after_add_called )
        self.failIf( foo.before_delete_called )

        foo.reset()
        test._delObject('foo')
        self.failIf( foo.after_add_called )
        self.failUnless( foo.before_delete_called )

        foo.reset()
        test._setObject('foo', foo)
        test._delOb('foo')    # doesn't propagate
        self.failUnless( foo.after_add_called )
        self.failIf( foo.before_delete_called )
开发者ID:goschtl,项目名称:zope,代码行数:23,代码来源:test_PortalFolder.py

示例5: test_deletePropagation

# 需要导入模块: from Products.CMFCore.tests.base.dummy import DummyContent [as 别名]
# 或者: from Products.CMFCore.tests.base.dummy.DummyContent import reset [as 别名]
    def test_deletePropagation( self ):

        test = self.root.test
        foo = DummyContent( 'foo' )

        foo.reset()
        assert not foo.after_add_called
        assert not foo.before_delete_called
        test._setObject( 'foo', foo )
        assert foo.after_add_called
        assert not foo.before_delete_called

        foo.reset()
        test._delObject( 'foo' )
        assert not foo.after_add_called
        assert foo.before_delete_called

        foo.reset()
        test._setObject( 'foo', foo )
        test._delOb( 'foo' )    # doesn't propagate
        assert foo.after_add_called
        assert not foo.before_delete_called
开发者ID:goschtl,项目名称:zope,代码行数:24,代码来源:test_PortalFolder.py

示例6: test_deletePropagation

# 需要导入模块: from Products.CMFCore.tests.base.dummy import DummyContent [as 别名]
# 或者: from Products.CMFCore.tests.base.dummy.DummyContent import reset [as 别名]
    def test_deletePropagation(self):
        acl_users = self.site._setObject('acl_users', DummyUserFolder())
        newSecurityManager(None, acl_users.all_powerful_Oz)
        test = self._makeOne('test')
        foo = DummyContent('foo')
        foo.reset()
        self.assertFalse(foo.after_add_called)
        self.assertFalse(foo.before_delete_called)

        test._setObject('foo', foo)
        self.assertTrue(foo.after_add_called)
        self.assertFalse(foo.before_delete_called)

        foo.reset()
        test._delObject('foo')
        self.assertFalse(foo.after_add_called)
        self.assertTrue(foo.before_delete_called)

        foo.reset()
        test._setObject('foo', foo)
        test._delOb('foo')    # doesn't propagate
        self.assertTrue(foo.after_add_called)
        self.assertFalse(foo.before_delete_called)
开发者ID:goschtl,项目名称:zope,代码行数:25,代码来源:test_PortalFolder.py


注:本文中的Products.CMFCore.tests.base.dummy.DummyContent.reset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。