本文整理汇总了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 )
示例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
示例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)
示例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 )
示例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
示例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)