[832] | 1 | # |
---|
| 2 | # Test adding comments possibility on switching on/off moderation |
---|
| 3 | # |
---|
| 4 | |
---|
[3113] | 5 | from Products.CMFCore.utils import getToolByName |
---|
[832] | 6 | from zExceptions import Unauthorized |
---|
[3112] | 7 | from quintagroup.plonecomments.tests.base import FunctionalTestCase |
---|
| 8 | from quintagroup.plonecomments.tests.config import USERS, PROPERTY_SHEET, \ |
---|
| 9 | DM_USERS_IDS, COMMON_USERS_IDS |
---|
[832] | 10 | |
---|
| 11 | |
---|
| 12 | class TestCommBase(FunctionalTestCase): |
---|
| 13 | |
---|
| 14 | def afterSetUp(self): |
---|
| 15 | self.loginAsPortalOwner() |
---|
| 16 | self.request = self.app.REQUEST |
---|
| 17 | |
---|
[3114] | 18 | # VERY IMPORTANT to guarantee product skin's content visibility |
---|
[832] | 19 | self._refreshSkinData() |
---|
| 20 | |
---|
| 21 | # Add all users |
---|
| 22 | self.membership = getToolByName(self.portal, 'portal_membership', None) |
---|
| 23 | for user_id in USERS.keys(): |
---|
[880] | 24 | self.membership.addMember(user_id, USERS[user_id]['passw'], |
---|
[3114] | 25 | USERS[user_id]['roles'], []) |
---|
[832] | 26 | |
---|
| 27 | # Add users to Discussion Manager group |
---|
| 28 | portal_groups = getToolByName(self.portal, 'portal_groups') |
---|
| 29 | dm_group = portal_groups.getGroupById('DiscussionManager') |
---|
[3114] | 30 | [dm_group.addMember(u) for u in DM_USERS_IDS] |
---|
[832] | 31 | |
---|
| 32 | # Allow discussion for Document |
---|
| 33 | portal_types = getToolByName(self.portal, 'portal_types', None) |
---|
| 34 | doc_fti = portal_types.getTypeInfo('Document') |
---|
| 35 | doc_fti._updateProperty('allow_discussion', 1) |
---|
| 36 | |
---|
| 37 | # Make sure Documents are visible by default |
---|
| 38 | # XXX only do this for plone 3 |
---|
| 39 | self.portal.portal_workflow.setChainForPortalTypes(('Document',), 'plone_workflow') |
---|
| 40 | |
---|
| 41 | # Add testing documents to portal. Add one document for avery user. |
---|
| 42 | # For testing behaviors, where made some changes to document state it's more usefull. |
---|
| 43 | self.discussion = getToolByName(self.portal, 'portal_discussion', None) |
---|
| 44 | self.all_users_id = DM_USERS_IDS + COMMON_USERS_IDS |
---|
| 45 | for user_id in self.all_users_id: |
---|
| 46 | doc_id = 'doc_%s' % user_id |
---|
| 47 | self.portal.invokeFactory('Document', id=doc_id) |
---|
| 48 | doc_obj = getattr(self.portal, doc_id) |
---|
| 49 | doc_obj.edit(text_format='plain', text='hello world from %s' % doc_id) |
---|
| 50 | # Create talkback for document and Add comment to doc_obj |
---|
| 51 | self.discussion.getDiscussionFor(doc_obj) |
---|
| 52 | doc_obj.discussion_reply('A Reply for %s' % doc_id,'text of reply for %s' % doc_id) |
---|
| 53 | |
---|
| 54 | |
---|
| 55 | class TestMixinAnonymOn: |
---|
| 56 | |
---|
| 57 | def afterSetUp(self): |
---|
| 58 | pass |
---|
| 59 | |
---|
| 60 | def testAddCommentToDocAnonymUsers(self): |
---|
[880] | 61 | |
---|
[832] | 62 | # ADDING COMMENTS MUST ALLOWED for anonymous users |
---|
| 63 | self.login('dm_admin') |
---|
| 64 | doc_obj = getattr(self.portal, "doc_anonym") |
---|
| 65 | replies_before = len(self.discussion.getDiscussionFor(doc_obj).getReplies()) |
---|
[880] | 66 | |
---|
[832] | 67 | # Create talkback for document and Add comment |
---|
| 68 | self.logout() |
---|
| 69 | doc_obj.discussion_reply("Anonym reply", "text of 'anonym' reply") |
---|
| 70 | self.login('dm_admin') |
---|
| 71 | replies_after = len(self.discussion.getDiscussionFor(doc_obj).getReplies()) |
---|
[880] | 72 | self.failUnless(replies_after-replies_before, |
---|
[3114] | 73 | "Anonymous user CAN'T really add comment in terned ON *Anonymous commenting mode*.") |
---|
[832] | 74 | |
---|
| 75 | def testAddCommentToDocNotAnonymUsers(self): |
---|
[880] | 76 | |
---|
[832] | 77 | # All users CAN ADD COMMENTS |
---|
| 78 | not_anonym_users = [u for u in self.all_users_id if not u=='anonym'] |
---|
| 79 | failed_users = [] |
---|
| 80 | for u in not_anonym_users: |
---|
| 81 | self.login('dm_admin') |
---|
| 82 | doc_id = "doc_%s" % u |
---|
| 83 | doc_obj = getattr(self.portal, doc_id) |
---|
| 84 | replies_before = self.discussion.getDiscussionFor(doc_obj).getReplies() |
---|
| 85 | self.login(u) |
---|
[880] | 86 | |
---|
[832] | 87 | # Create talkback for document and Add comment |
---|
| 88 | doc_obj.discussion_reply("%s's reply" % u, "text of '%s' reply" % u) |
---|
[880] | 89 | |
---|
[832] | 90 | # Check is comment added |
---|
| 91 | self.login('dm_admin') |
---|
| 92 | replies_after = self.discussion.getDiscussionFor(doc_obj).getReplies() |
---|
| 93 | disparity = len(replies_after) - len(replies_before) |
---|
| 94 | if not disparity: |
---|
| 95 | failed_users.append(u) |
---|
[880] | 96 | self.failIf(failed_users, "%s - user(s) can not really add comment." % failed_users) |
---|
[832] | 97 | |
---|
| 98 | |
---|
| 99 | class TestMixinAnonymOff: |
---|
| 100 | |
---|
| 101 | def afterSetUp(self): |
---|
| 102 | all_users_id = DM_USERS_IDS + COMMON_USERS_IDS |
---|
| 103 | self.not_like_anonym = ['admin', 'member', 'dm_admin', 'dm_member'] |
---|
| 104 | self.like_anonym = [u for u in all_users_id if u not in self.not_like_anonym] |
---|
| 105 | |
---|
| 106 | |
---|
| 107 | def testAddCommentToDocLikeAnonymUsers(self): |
---|
[880] | 108 | |
---|
[832] | 109 | # ADDING COMMENTS MUST REFUSED for anonymous users |
---|
| 110 | failed_users = [] |
---|
| 111 | for u in self.like_anonym: |
---|
| 112 | self.login('dm_admin') |
---|
| 113 | doc_obj = getattr(self.portal, "doc_%s" % u) |
---|
| 114 | replies_before = self.discussion.getDiscussionFor(doc_obj).getReplies() |
---|
[880] | 115 | |
---|
[832] | 116 | # Create talkback for document and Add comment |
---|
| 117 | self.logout() |
---|
| 118 | if not u=='anonym': |
---|
| 119 | self.login(u) |
---|
[880] | 120 | self.assertRaises(Unauthorized, doc_obj.discussion_reply, |
---|
[3114] | 121 | "%s's reply" % u, "text of '%s' reply" % u) |
---|
[832] | 122 | self.login('dm_admin') |
---|
| 123 | replies_after = self.discussion.getDiscussionFor(doc_obj).getReplies() |
---|
| 124 | disparity = len(replies_after) - len(replies_before) |
---|
| 125 | if disparity: |
---|
| 126 | failed_users.append(u) |
---|
[880] | 127 | self.failIf(failed_users, |
---|
[3114] | 128 | "%s user(s) CAN really add comment in terned OFF " |
---|
| 129 | "*Anonymous commenting mode*." % failed_users) |
---|
[832] | 130 | |
---|
| 131 | |
---|
| 132 | def testAddCommentToDocNotLikeAnonymUsers(self): |
---|
[880] | 133 | |
---|
[832] | 134 | # All users CAN ADD COMMENTS |
---|
| 135 | failed_users = [] |
---|
| 136 | for u in self.not_like_anonym: |
---|
| 137 | self.login('dm_admin') |
---|
| 138 | doc_id = "doc_%s" % u |
---|
| 139 | doc_obj = getattr(self.portal, doc_id) |
---|
| 140 | replies_before = self.discussion.getDiscussionFor(doc_obj).getReplies() |
---|
| 141 | self.login(u) |
---|
[880] | 142 | |
---|
[832] | 143 | # Create talkback for document and Add comment |
---|
| 144 | doc_obj.discussion_reply("%s's reply" % u, "text of '%s' reply" % u) |
---|
[880] | 145 | |
---|
[832] | 146 | # Check is comment added |
---|
| 147 | self.login('dm_admin') |
---|
| 148 | replies_after = self.discussion.getDiscussionFor(doc_obj).getReplies() |
---|
| 149 | disparity = len(replies_after) - len(replies_before) |
---|
| 150 | if not disparity: |
---|
| 151 | failed_users.append(u) |
---|
[880] | 152 | self.failIf(failed_users, |
---|
[3114] | 153 | "%s - user(s) can not really add commentin terned OFF " |
---|
| 154 | "*Anonymous commenting mode*." % failed_users) |
---|
[832] | 155 | |
---|
| 156 | |
---|
| 157 | class TestMixinModerationOn: |
---|
| 158 | |
---|
| 159 | def afterSetUp(self): |
---|
[880] | 160 | |
---|
[832] | 161 | # Get Moderation state |
---|
| 162 | pp = getToolByName(self.portal, 'portal_properties') |
---|
[880] | 163 | config_ps = getattr(pp, PROPERTY_SHEET, None) |
---|
[832] | 164 | EnableAnonymComm = getattr(config_ps, "enable_anonymous_commenting") |
---|
[880] | 165 | |
---|
[832] | 166 | # Group users depending on Anonymous commenting enabling/disabling |
---|
| 167 | if EnableAnonymComm: |
---|
| 168 | self.allowable_dm_users = DM_USERS_IDS |
---|
| 169 | self.allowable_common_users = COMMON_USERS_IDS |
---|
| 170 | self.illegal_dm_users = [] |
---|
| 171 | self.illegal_common_users = [] |
---|
| 172 | else: |
---|
| 173 | self.allowable_dm_users = ['dm_admin', 'dm_member'] |
---|
| 174 | self.allowable_common_users = ['admin', 'member'] |
---|
| 175 | self.illegal_dm_users = [u for u in DM_USERS_IDS if not u in self.allowable_dm_users] |
---|
| 176 | self.illegal_common_users = [u for u in COMMON_USERS_IDS if not u in self.allowable_common_users] |
---|
| 177 | |
---|
| 178 | |
---|
| 179 | def testAddCommentToNotPublishedReplyDMUsers(self): |
---|
[880] | 180 | |
---|
[832] | 181 | # DiscussionManager's group's members with Manager or Member roles CAN ADD COMMENTS |
---|
| 182 | # to reply IN ANY STATE (published/not published) |
---|
| 183 | failed_users = [] |
---|
| 184 | for u in self.allowable_dm_users: |
---|
| 185 | self.login(u) |
---|
| 186 | doc_obj = getattr(self.portal, "doc_%s" % u) |
---|
| 187 | # Get reply to this document |
---|
| 188 | reply = self.discussion.getDiscussionFor(doc_obj).getReplies()[0] |
---|
| 189 | # Create talkback for reply and Add comment |
---|
| 190 | self.discussion.getDiscussionFor(reply) |
---|
| 191 | reply.discussion_reply("%s's reply" % u, "text of '%s' reply" % u) |
---|
| 192 | replies_to_reply = self.discussion.getDiscussionFor(reply).getReplies() |
---|
| 193 | if not replies_to_reply: |
---|
| 194 | failed_users.append(u) |
---|
[880] | 195 | self.failIf(failed_users, |
---|
[3114] | 196 | "%s - member(s) of DiscussionManager group CAN'T really ADD comment" % failed_users) |
---|
[880] | 197 | |
---|
[832] | 198 | # This is actual only in terned OFF *Anonymous commenting mode* |
---|
| 199 | failed_users = [] |
---|
| 200 | for u in self.illegal_dm_users: |
---|
| 201 | self.login(u) |
---|
| 202 | doc_obj = getattr(self.portal, "doc_%s" % u) |
---|
| 203 | # Get reply to this document |
---|
| 204 | reply = self.discussion.getDiscussionFor(doc_obj).getReplies()[0] |
---|
| 205 | # Create talkback for reply and Add comment |
---|
| 206 | self.discussion.getDiscussionFor(reply) |
---|
| 207 | self.assertRaises(Unauthorized, reply.discussion_reply, "%s's reply" % u, "text of '%s' reply" % u) |
---|
| 208 | replies_to_reply = self.discussion.getDiscussionFor(reply).getReplies() |
---|
| 209 | if replies_to_reply: |
---|
| 210 | failed_users.append(u) |
---|
[880] | 211 | self.failIf(failed_users, |
---|
[3114] | 212 | "%s user(s) CAN really add comment in terned OFF " |
---|
| 213 | "*Anonymous commenting mode*." % failed_users) |
---|
[832] | 214 | |
---|
| 215 | """ |
---|
| 216 | def testAddCommentToNotPublishedReplyNotDMUsers(self): |
---|
| 217 | # Users without DiscussionManager role CAN'T ACCESS an so ADD COMMENTS |
---|
| 218 | # TO NOT PUBLISHED reply. |
---|
| 219 | manager = 'dm_admin' |
---|
| 220 | for u in self.allowable_common_users: |
---|
| 221 | self.login(manager) |
---|
| 222 | doc_obj = getattr(self.portal, "doc_%s" % u) |
---|
| 223 | reply = self.discussion.getDiscussionFor(doc_obj).getReplies()[0] |
---|
| 224 | reply_to_reply = self.discussion.getDiscussionFor(reply).getReplies() |
---|
| 225 | reply_to_reply_before = len(reply_to_reply) |
---|
| 226 | self.logout() |
---|
| 227 | if not u=='anonym': |
---|
| 228 | self.login(u) |
---|
| 229 | # On adding reply to not published reply MUST generte Unauthorized exception |
---|
| 230 | self.assertRaises(Unauthorized, reply.discussion_reply, "Reply %s" % u, "text of %s reply" % u) |
---|
| 231 | """ |
---|
| 232 | |
---|
| 233 | def testAddCommentToPublishedReplyALLUsers(self): |
---|
[880] | 234 | |
---|
[832] | 235 | # All users CAN ADD COMMENTS to published reply |
---|
| 236 | manager = 'dm_admin' |
---|
| 237 | allowable_users = self.allowable_dm_users + self.allowable_common_users |
---|
| 238 | illegal_users = self.illegal_dm_users + self.illegal_common_users |
---|
| 239 | all_users = allowable_users + illegal_users |
---|
[880] | 240 | |
---|
[832] | 241 | # 1. Publish comments |
---|
| 242 | self.login(manager) |
---|
| 243 | for u in all_users: |
---|
| 244 | doc_obj = getattr(self.portal, "doc_%s" % u) |
---|
| 245 | reply = self.discussion.getDiscussionFor(doc_obj).getReplies()[0] |
---|
| 246 | reply.discussion_publish_comment() |
---|
[880] | 247 | |
---|
[832] | 248 | # 2.Check adding reply to reply for allowable users |
---|
| 249 | failed_users = [] |
---|
| 250 | for u in allowable_users: |
---|
| 251 | self.logout() |
---|
| 252 | if not u=='anonym': |
---|
| 253 | self.login(u) |
---|
[880] | 254 | |
---|
[832] | 255 | # Create talkback for document and Add comment |
---|
| 256 | self.discussion.getDiscussionFor(reply) |
---|
| 257 | reply.discussion_reply("Reply %s" % u, "text of %s reply" % u) |
---|
[880] | 258 | |
---|
[832] | 259 | # Check is comment added |
---|
| 260 | self.login(manager) |
---|
| 261 | reply_to_reply = self.discussion.getDiscussionFor(reply).getReplies() |
---|
| 262 | if not reply_to_reply: |
---|
| 263 | failed_users.append(u) |
---|
[880] | 264 | self.failIf(failed_users, |
---|
[3114] | 265 | "%s - user(s) can not really add comment to PUBLISHED reply." % failed_users) |
---|
[880] | 266 | |
---|
[832] | 267 | # 3.Check adding reply to reply for illegal users |
---|
| 268 | for u in illegal_users: |
---|
| 269 | self.logout() |
---|
| 270 | if not u=='anonym': |
---|
| 271 | self.login(u) |
---|
[880] | 272 | |
---|
[832] | 273 | # On adding reply to not published reply MUST generte Unauthorized exception |
---|
| 274 | self.discussion.getDiscussionFor(reply) |
---|
[880] | 275 | self.assertRaises(Unauthorized, reply.discussion_reply, |
---|
[3114] | 276 | "Reply %s" % u, "text of %s reply" % u) |
---|
[832] | 277 | |
---|
| 278 | |
---|
| 279 | class TestMixinModerationOff: |
---|
| 280 | |
---|
| 281 | def afterSetUp(self): |
---|
[880] | 282 | |
---|
[832] | 283 | # Get Moderation state |
---|
| 284 | pp = getToolByName(self.portal, 'portal_properties') |
---|
[880] | 285 | config_ps = getattr(pp, PROPERTY_SHEET, None) |
---|
[832] | 286 | EnableAnonymComm = getattr(config_ps, "enable_anonymous_commenting") |
---|
[880] | 287 | |
---|
[832] | 288 | # Group users depending on Anonymous commenting enabling/disabling |
---|
| 289 | if EnableAnonymComm: |
---|
| 290 | self.allowable_users = DM_USERS_IDS + COMMON_USERS_IDS |
---|
| 291 | self.illegal_users = [] |
---|
| 292 | else: |
---|
| 293 | self.allowable_users = ['dm_admin', 'dm_member', 'admin', 'member'] |
---|
| 294 | self.illegal_users = [u for u in self.all_users_id if not u in self.allowable_users] |
---|
| 295 | |
---|
| 296 | # Add testing document to portal in Moderation OFF mode. |
---|
| 297 | self.discussion = getToolByName(self.portal, 'portal_discussion', None) |
---|
| 298 | self.doc_moder_off_id = 'doc_moderation_off' |
---|
| 299 | self.portal.invokeFactory('Document', id=self.doc_moder_off_id) |
---|
| 300 | doc_obj = getattr(self.portal, self.doc_moder_off_id) |
---|
| 301 | doc_obj.edit(text_format='plain', text='hello world from in moderation off mode') |
---|
[880] | 302 | |
---|
[832] | 303 | # Create talkback for document and Add comment to 'doc_moderatio_off' |
---|
| 304 | self.discussion.getDiscussionFor(doc_obj) |
---|
[880] | 305 | doc_obj.discussion_reply("A Reply to '%s'" % self.doc_moder_off_id, |
---|
[3114] | 306 | "text of reply to '%s'" % self.doc_moder_off_id) |
---|
[832] | 307 | |
---|
| 308 | |
---|
| 309 | def testAddCommentToReplyAllowableUsers(self): |
---|
[880] | 310 | |
---|
[832] | 311 | # Users CAN ADD COMMENTS |
---|
| 312 | failed_users = [] |
---|
| 313 | for u in self.allowable_users: |
---|
| 314 | self.logout() |
---|
| 315 | if not u=='anonym': |
---|
| 316 | self.login(u) |
---|
| 317 | doc_obj = getattr(self.portal, self.doc_moder_off_id) |
---|
[880] | 318 | |
---|
[832] | 319 | # Get reply to this document |
---|
| 320 | reply_to_doc = self.discussion.getDiscussionFor(doc_obj).getReplies()[0] |
---|
[880] | 321 | |
---|
[832] | 322 | # Create talkback for reply and Add comment |
---|
| 323 | replies_before = self.discussion.getDiscussionFor(reply_to_doc).getReplies() |
---|
| 324 | if not replies_before: |
---|
| 325 | self.discussion.getDiscussionFor(reply_to_doc) |
---|
| 326 | reply_to_doc.discussion_reply("%s's reply" % u, "text of '%s' reply" % u) |
---|
| 327 | replies_after = self.discussion.getDiscussionFor(reply_to_doc).getReplies() |
---|
| 328 | disparity = len(replies_after) - len(replies_before) |
---|
| 329 | if not disparity: |
---|
| 330 | failed_users.append(u) |
---|
[880] | 331 | self.failIf(failed_users , |
---|
[3114] | 332 | "%s - member(s) CAN'T really ADD comment in terned off" |
---|
| 333 | " comments Moderation mode." % failed_users) |
---|
[832] | 334 | |
---|
| 335 | |
---|
| 336 | def testAddCommentToReplyIllegalUsers(self): |
---|
[880] | 337 | |
---|
[832] | 338 | # This users CAN'T ADD COMMENTS |
---|
| 339 | # This is actual only in terned OFF *Anonymous commenting mode* |
---|
| 340 | for u in self.illegal_users: |
---|
| 341 | self.logout() |
---|
| 342 | if not u=='anonym': |
---|
| 343 | self.login(u) |
---|
| 344 | doc_obj = getattr(self.portal, self.doc_moder_off_id) |
---|
[880] | 345 | |
---|
[832] | 346 | # Get reply to this document |
---|
| 347 | reply_to_doc = self.discussion.getDiscussionFor(doc_obj).getReplies()[0] |
---|
[880] | 348 | |
---|
[832] | 349 | # Create talkback for reply and Add comment |
---|
| 350 | self.discussion.getDiscussionFor(reply_to_doc) |
---|
[880] | 351 | self.assertRaises(Unauthorized, reply_to_doc.discussion_reply, |
---|
[3114] | 352 | "%s's reply" % u, "text of '%s' reply" % u) |
---|
[832] | 353 | |
---|
| 354 | |
---|
| 355 | class TestModerationAnonymComm(TestCommBase, TestMixinAnonymOn, TestMixinModerationOn): |
---|
| 356 | |
---|
| 357 | def afterSetUp(self): |
---|
| 358 | TestCommBase.afterSetUp(self) |
---|
[880] | 359 | |
---|
[832] | 360 | # Preparation for functional testing |
---|
| 361 | # Tern On Moderation and tern on Anonymous commenting |
---|
| 362 | self.request.form['enable_anonymous_commenting'] = 'True' |
---|
| 363 | self.request.form['enable_moderation'] = 'True' |
---|
| 364 | self.portal.prefs_comments_setup() |
---|
[880] | 365 | |
---|
[832] | 366 | # Initialize base classes |
---|
| 367 | TestMixinAnonymOn.afterSetUp(self) |
---|
| 368 | TestMixinModerationOn.afterSetUp(self) |
---|
| 369 | |
---|
| 370 | |
---|
| 371 | class TestModerationOFFAnonymComm(TestCommBase, TestMixinAnonymOff, TestMixinModerationOn): |
---|
| 372 | |
---|
| 373 | def afterSetUp(self): |
---|
| 374 | TestCommBase.afterSetUp(self) |
---|
[880] | 375 | |
---|
[832] | 376 | # Preparation for functional testing |
---|
| 377 | # Tern On Moderation and tern off Anonymous commenting |
---|
| 378 | self.request.form['enable_moderation'] = 'True' |
---|
| 379 | self.portal.prefs_comments_setup() |
---|
[880] | 380 | |
---|
[832] | 381 | # Initialize base classes |
---|
| 382 | TestMixinAnonymOff.afterSetUp(self) |
---|
| 383 | TestMixinModerationOn.afterSetUp(self) |
---|
| 384 | |
---|
| 385 | |
---|
| 386 | class TestAnonymCommOFFModeration(TestCommBase, TestMixinAnonymOn, TestMixinModerationOff): |
---|
| 387 | |
---|
| 388 | def afterSetUp(self): |
---|
| 389 | TestCommBase.afterSetUp(self) |
---|
[880] | 390 | |
---|
[832] | 391 | # Preparation for functional testing |
---|
| 392 | # Tern On Anonymous commenting and tern off Moderation |
---|
| 393 | self.request.form['enable_anonymous_commenting'] = 'True' |
---|
| 394 | self.portal.prefs_comments_setup() |
---|
[880] | 395 | |
---|
[832] | 396 | # Initialize base classes |
---|
| 397 | TestMixinAnonymOn.afterSetUp(self) |
---|
| 398 | TestMixinModerationOff.afterSetUp(self) |
---|
| 399 | |
---|
| 400 | |
---|
| 401 | class TestOFFModerationOFFAnonymComm(TestCommBase, TestMixinAnonymOff, TestMixinModerationOff): |
---|
| 402 | |
---|
| 403 | def afterSetUp(self): |
---|
| 404 | TestCommBase.afterSetUp(self) |
---|
[880] | 405 | |
---|
[832] | 406 | # Preparation for functional testing |
---|
| 407 | # Tern Off Moderation and tern off Anonymous commenting |
---|
| 408 | self.portal.prefs_comments_setup() |
---|
[880] | 409 | |
---|
[832] | 410 | # Initialize base classes |
---|
| 411 | TestMixinAnonymOff.afterSetUp(self) |
---|
| 412 | TestMixinModerationOff.afterSetUp(self) |
---|
| 413 | |
---|
| 414 | |
---|
| 415 | def test_suite(): |
---|
| 416 | from unittest import TestSuite, makeSuite |
---|
| 417 | suite = TestSuite() |
---|
| 418 | suite.addTest(makeSuite(TestModerationAnonymComm)) |
---|
| 419 | suite.addTest(makeSuite(TestModerationOFFAnonymComm)) |
---|
| 420 | suite.addTest(makeSuite(TestAnonymCommOFFModeration)) |
---|
| 421 | suite.addTest(makeSuite(TestOFFModerationOFFAnonymComm)) |
---|
| 422 | |
---|
| 423 | return suite |
---|