[CMF-checkins] CVS: Products/CMFDefault/tests -
test_DiscussionReply.py:1.1.2.2
Stefan H. Holek
stefan at epy.co.at
Fri Jan 21 16:45:04 EST 2005
Update of /cvs-repository/Products/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv2368/tests
Modified Files:
Tag: CMF-1_4-branch
test_DiscussionReply.py
Log Message:
More tests for http://zope.org/Collectors/CMF/318
=== Products/CMFDefault/tests/test_DiscussionReply.py 1.1.2.1 => 1.1.2.2 ===
--- Products/CMFDefault/tests/test_DiscussionReply.py:1.1.2.1 Wed Jan 19 11:40:52 2005
+++ Products/CMFDefault/tests/test_DiscussionReply.py Fri Jan 21 16:45:04 2005
@@ -32,7 +32,9 @@
self.discussion = self.portal.portal_discussion
self.portal.invokeFactory('Document', id='doc')
self.discussion.overrideDiscussionFor(self.portal.doc, 1)
- self.discussion.getDiscussionFor(self.portal.doc)
+ # Publish it
+ self.workflow = self.portal.portal_workflow
+ self.workflow.doActionFor(self.portal.doc, 'publish')
except:
self.tearDown()
raise
@@ -47,15 +49,32 @@
newSecurityManager(None, user)
def testDiscussionReply(self):
+ self.discussion.getDiscussionFor(self.portal.doc)
self.portal.doc.talkback.discussion_reply('Title', 'Text')
reply = self.portal.doc.talkback.objectValues()[0]
self.assertEqual(reply.Title(), 'Title')
self.assertEqual(reply.EditableBody(), 'Text')
+class DiscussionReplyTestMember(DiscussionReplyTest):
+
+ # Run the test again as another Member, i.e. reply to someone
+ # else's document.
+
+ def setUp(self):
+ DiscussionReplyTest.setUp(self)
+ try:
+ self.uf.userFolderAddUser('member', '', ['Member'], [])
+ self.login('member')
+ except:
+ self.tearDown()
+ raise
+
+
def test_suite():
suite = TestSuite()
suite.addTest(makeSuite(DiscussionReplyTest))
+ suite.addTest(makeSuite(DiscussionReplyTestMember))
return suite
if __name__ == '__main__':
More information about the CMF-checkins
mailing list