[CMF-checkins] CVS: Products/CMFDefault/tests -
test_Discussions.py:1.19.6.2
Stefan H. Holek
stefan at epy.co.at
Mon Jan 17 19:45:58 EST 2005
Update of /cvs-repository/Products/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv25712/CMFDefault/tests
Modified Files:
Tag: CMF-1_5-branch
test_Discussions.py
Log Message:
Make sure getDiscussionFor returns acquisition-wrapped talkback objects.
=== Products/CMFDefault/tests/test_Discussions.py 1.19.6.1 => 1.19.6.2 ===
--- Products/CMFDefault/tests/test_Discussions.py:1.19.6.1 Fri Sep 3 13:04:36 2004
+++ Products/CMFDefault/tests/test_Discussions.py Mon Jan 17 19:45:27 2005
@@ -4,6 +4,7 @@
Zope.startup()
from Interface.Verify import verifyClass
+from Products.CMFCore.utils import getToolByName
from Products.CMFCore.CatalogTool import CatalogTool
from Products.CMFCore.tests.base.dummy import DummyContent
from Products.CMFCore.tests.base.dummy import DummySite
@@ -246,6 +247,25 @@
talkback1 = dtool.getDiscussionFor(reply1)
self.assertEqual(len(talkback.getReplies()), 1)
self.assertEqual(len(talkback1.getReplies()), 0)
+
+ def test_newTalkbackIsWrapped(self):
+ test = self._makeDummyContent('test')
+ test.allow_discussion = 1
+ dtool = self.site.portal_discussion
+ talkback = dtool.getDiscussionFor(test)
+ self.failUnless(hasattr(talkback, 'aq_base'))
+ # Acquire a portal tool
+ self.failUnless(getToolByName(talkback, 'portal_discussion'))
+
+ def test_existingTalkbackIsWrapped(self):
+ test = self._makeDummyContent('test')
+ test.allow_discussion = 1
+ dtool = self.site.portal_discussion
+ talkback = dtool.getDiscussionFor(test)
+ talkback = dtool.getDiscussionFor(test)
+ self.failUnless(hasattr(talkback, 'aq_base'))
+ # Acquire a portal tool
+ self.failUnless(getToolByName(talkback, 'portal_discussion'))
def test_suite():
More information about the CMF-checkins
mailing list