[CMF-checkins] CVS: Products/CMFDefault/tests - test_DiscussionReply.py:1.1.4.2

Stefan H. Holek stefan at epy.co.at
Fri Jan 21 17:00:02 EST 2005


Update of /cvs-repository/Products/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv7060/CMFDefault/tests

Modified Files:
      Tag: CMF-1_5-branch
	test_DiscussionReply.py 
Log Message:
More tests for http://zope.org/Collectors/CMF/318


=== Products/CMFDefault/tests/test_DiscussionReply.py 1.1.4.1 => 1.1.4.2 ===
--- Products/CMFDefault/tests/test_DiscussionReply.py:1.1.4.1	Wed Jan 19 11:41:09 2005
+++ Products/CMFDefault/tests/test_DiscussionReply.py	Fri Jan 21 17:00:01 2005
@@ -29,7 +29,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
@@ -44,15 +46,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