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