Changeset 3114 in products for quintagroup.plonecomments/trunk/quintagroup/plonecomments/tests/testQPloneCommentsCommenting.py
- Timestamp:
- Apr 14, 2011 4:45:57 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.plonecomments/trunk/quintagroup/plonecomments/tests/testQPloneCommentsCommenting.py
r3113 r3114 16 16 self.request = self.app.REQUEST 17 17 18 18 # VERY IMPORTANT to guarantee product skin's content visibility 19 19 self._refreshSkinData() 20 20 … … 23 23 for user_id in USERS.keys(): 24 24 self.membership.addMember(user_id, USERS[user_id]['passw'], 25 25 USERS[user_id]['roles'], []) 26 26 27 27 # Add users to Discussion Manager group 28 28 portal_groups = getToolByName(self.portal, 'portal_groups') 29 29 dm_group = portal_groups.getGroupById('DiscussionManager') 30 dm_users =[dm_group.addMember(u) for u in DM_USERS_IDS]30 [dm_group.addMember(u) for u in DM_USERS_IDS] 31 31 32 32 # Allow discussion for Document … … 71 71 replies_after = len(self.discussion.getDiscussionFor(doc_obj).getReplies()) 72 72 self.failUnless(replies_after-replies_before, 73 73 "Anonymous user CAN'T really add comment in terned ON *Anonymous commenting mode*.") 74 74 75 75 def testAddCommentToDocNotAnonymUsers(self): … … 119 119 self.login(u) 120 120 self.assertRaises(Unauthorized, doc_obj.discussion_reply, 121 121 "%s's reply" % u, "text of '%s' reply" % u) 122 122 self.login('dm_admin') 123 123 replies_after = self.discussion.getDiscussionFor(doc_obj).getReplies() … … 126 126 failed_users.append(u) 127 127 self.failIf(failed_users, 128 129 128 "%s user(s) CAN really add comment in terned OFF " 129 "*Anonymous commenting mode*." % failed_users) 130 130 131 131 … … 151 151 failed_users.append(u) 152 152 self.failIf(failed_users, 153 154 153 "%s - user(s) can not really add commentin terned OFF " 154 "*Anonymous commenting mode*." % failed_users) 155 155 156 156 … … 194 194 failed_users.append(u) 195 195 self.failIf(failed_users, 196 196 "%s - member(s) of DiscussionManager group CAN'T really ADD comment" % failed_users) 197 197 198 198 # This is actual only in terned OFF *Anonymous commenting mode* … … 210 210 failed_users.append(u) 211 211 self.failIf(failed_users, 212 213 212 "%s user(s) CAN really add comment in terned OFF " 213 "*Anonymous commenting mode*." % failed_users) 214 214 215 215 """ … … 263 263 failed_users.append(u) 264 264 self.failIf(failed_users, 265 265 "%s - user(s) can not really add comment to PUBLISHED reply." % failed_users) 266 266 267 267 # 3.Check adding reply to reply for illegal users … … 274 274 self.discussion.getDiscussionFor(reply) 275 275 self.assertRaises(Unauthorized, reply.discussion_reply, 276 276 "Reply %s" % u, "text of %s reply" % u) 277 277 278 278 … … 304 304 self.discussion.getDiscussionFor(doc_obj) 305 305 doc_obj.discussion_reply("A Reply to '%s'" % self.doc_moder_off_id, 306 306 "text of reply to '%s'" % self.doc_moder_off_id) 307 307 308 308 … … 330 330 failed_users.append(u) 331 331 self.failIf(failed_users , 332 333 332 "%s - member(s) CAN'T really ADD comment in terned off" 333 " comments Moderation mode." % failed_users) 334 334 335 335 … … 350 350 self.discussion.getDiscussionFor(reply_to_doc) 351 351 self.assertRaises(Unauthorized, reply_to_doc.discussion_reply, 352 352 "%s's reply" % u, "text of '%s' reply" % u) 353 353 354 354
Note: See TracChangeset
for help on using the changeset viewer.