Ejemplo n.º 1
0
 def test_deletePropagation(self):
    # import pdb; pdb.set_trace()
     portal_catalog = CatalogTool()
     self.root._setObject('portal_catalog', portal_catalog)
     catalog = self.root.portal_catalog
     portal_discussion = DiscussionTool()
     self.root._setObject('portal_discussion', portal_discussion)
     portal_url = URLTool()
     self.root._setObject('portal_url', portal_url)
     portal_workflow = WorkflowTool()
     self.root._setObject('portal_workflow', portal_workflow) 
     test = Document('test')
     self.root._setObject('test', test)
     test = self.root.test
     test.allow_discussion = 1
     assert len(catalog) == 1
     portal_discussion.createDiscussionFor(test)
     talkback = test.talkback
     talkback.createReply(title='test'
                          , text='blah'
                          )
     foo = talkback.getReplies()[0]
     assert len(catalog) == 2
     self.root._delObject('test')
     assert len(catalog) == 0
Ejemplo n.º 2
0
 def setUp(self):
     SecurityTest.setUp(self)
     setUpEvents()
     self.site = DummySite('site').__of__(self.root)
     self.site._setObject( 'portal_discussion', DiscussionTool() )
     self.site._setObject( 'portal_membership', DummyTool() )
     self.site._setObject( 'portal_types', TypesTool() )
Ejemplo n.º 3
0
 def setUp(self):
     SecurityTest.setUp(self)
     newSecurityManager(None, DummyUser().__of__(self.app.acl_users))
     self.site = DummySite('site').__of__(self.root)
     sm = getSiteManager()
     self.site._setObject('portal_discussion', DiscussionTool())
     sm.registerUtility(self.site.portal_discussion, IDiscussionTool)
     self.site._setObject('portal_types', TypesTool())
Ejemplo n.º 4
0
 def setUp(self):
     SecurityTest.setUp(self)
     self.site = DummySite('site').__of__(self.root)
     sm = getSiteManager()
     self.site._setObject('portal_discussion', DiscussionTool())
     sm.registerUtility(self.site.portal_discussion, IDiscussionTool)
     self.site._setObject('portal_membership', DummyTool())
     self.site._setObject('portal_types', TypesTool())
Ejemplo n.º 5
0
 def setUp(self):
     SecurityTest.setUp(self)
     newSecurityManager(None, DummyUser().__of__(self.app.acl_users))
     self.site = DummySite('site').__of__(self.app)
     self.dtool = DiscussionTool()
     self.ttool = TypesTool()
     sm = getSiteManager()
     sm.registerUtility(self.dtool, IDiscussionTool)
     sm.registerUtility(self.ttool, ITypesTool)
Ejemplo n.º 6
0
 def test_deletePropagation(self):
     # import pdb; pdb.set_trace()
     portal_catalog = CatalogTool()
     self.root._setObject('portal_catalog', portal_catalog)
     catalog = self.root.portal_catalog
     portal_discussion = DiscussionTool()
     self.root._setObject('portal_discussion', portal_discussion)
     portal_url = URLTool()
     self.root._setObject('portal_url', portal_url)
     portal_workflow = WorkflowTool()
     self.root._setObject('portal_workflow', portal_workflow)
     test = Document('test')
     self.root._setObject('test', test)
     test = self.root.test
     test.allow_discussion = 1
     assert len(catalog) == 1
     portal_discussion.createDiscussionFor(test)
     talkback = test.talkback
     talkback.createReply(title='test', text='blah')
     foo = talkback.getReplies()[0]
     assert len(catalog) == 2
     self.root._delObject('test')
     assert len(catalog) == 0
Ejemplo n.º 7
0
 def setUp(self):
     get_transaction().begin()
     self._policy = UnitTestSecurityPolicy()
     SecurityManager.setSecurityPolicy(self._policy)
     self.root = Zope.app()
     self.root._setObject('portal_discussion', DiscussionTool())
     self.discussion_tool = self.root.portal_discussion
     self.root._setObject('portal_catalog', CatalogTool())
     self.catalog_tool = self.root.portal_catalog
     self.root._setObject('portal_url', URLTool())
     self.url_tool = self.root.portal_url
     self.root._setObject('portal_workflow', WorkflowTool())
     self.workflow_tool = self.root.portal_workflow
     self.root._setObject('portal_types', TypesTool())
     types_tool = self.types_tool = self.root.portal_types
Ejemplo n.º 8
0
 def setUp( self ):
     
     SecurityTest.setUp(self)
     
     root = self.root
     root._setObject( 'portal_discussion', DiscussionTool() )
     self.discussion_tool = root.portal_discussion
     root._setObject( 'portal_catalog', CatalogTool() )
     self.catalog_tool = root.portal_catalog
     root._setObject( 'portal_url', URLTool() )
     self.url_tool = root.portal_url
     root._setObject( 'portal_workflow', WorkflowTool() ) 
     self.workflow_tool = root.portal_workflow
     root._setObject( 'portal_types', TypesTool() )
     types_tool = self.types_tool = root.portal_types
     try: root._delObject('test')
     except AttributeError: pass
     root._setObject( 'test', Document( 'test' ) )
Ejemplo n.º 9
0
    def _makeOne(self, *args, **kw):
        from Products.CMFDefault.DiscussionTool import DiscussionTool

        return DiscussionTool(*args, **kw)
Ejemplo n.º 10
0
 def setUp(self):
     self.site = DummySite('site')
     self.site._setObject('portal_discussion', DiscussionTool())
     self.site._setObject('portal_membership', DummyTool())