[CMF-checkins] CVS: Products/CMFDefault/tests -
test_Discussions.py:1.14.26.3
Stefan H. Holek
stefan at epy.co.at
Mon Jan 17 19:45:59 EST 2005
Update of /cvs-repository/Products/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv26324/CMFDefault/tests
Modified Files:
Tag: CMF-1_4-branch
test_Discussions.py
Log Message:
Make sure getDiscussionFor returns acquisition-wrapped talkback objects.
=== Products/CMFDefault/tests/test_Discussions.py 1.14.26.2 => 1.14.26.3 ===
--- Products/CMFDefault/tests/test_Discussions.py:1.14.26.2 Fri Sep 10 06:06:08 2004
+++ Products/CMFDefault/tests/test_Discussions.py Mon Jan 17 19:45:59 2005
@@ -13,6 +13,8 @@
from Products.CMFCore.tests.base.utils import \
has_path
+from Products.CMFCore.utils import getToolByName
+
from Products.CMFCore.tests.base.dummy import DummyFTI
from Products.CMFCore.tests.base.dummy import DummyContent
@@ -253,6 +255,24 @@
talkback1 = self.discussion_tool.getDiscussionFor(reply1)
self.assertEqual(len(talkback.getReplies()), 1)
self.assertEqual(len(talkback1.getReplies()), 0)
+
+ def test_newTalkbackIsWrapped(self):
+ test = self.root.test
+ test.allow_discussion = 1
+ talkback = self.discussion_tool.getDiscussionFor(test)
+ self.failUnless(hasattr(talkback, 'aq_base'))
+ # Acquire a portal tool
+ self.failUnless(getToolByName(talkback, 'portal_discussion'))
+
+ def test_existingTalkbackIsWrapped(self):
+ test = self.root.test
+ test.allow_discussion = 1
+ talkback = self.discussion_tool.getDiscussionFor(test)
+ talkback = self.discussion_tool.getDiscussionFor(test)
+ self.failUnless(hasattr(talkback, 'aq_base'))
+ # Acquire a portal tool
+ self.failUnless(getToolByName(talkback, 'portal_discussion'))
+
def test_suite():
return TestSuite((
More information about the CMF-checkins
mailing list