[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 | 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, |
---|
[3114] | 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, |
---|
[3114] | 127 | "%s user(s) CAN really add comment in terned OFF " |
---|
| 128 | "*Anonymous commenting mode*." % failed_users) |
---|
[832] | 129 | |
---|
| 130 | def testAddCommentToDocNotLikeAnonymUsers(self): |
---|
[880] | 131 | |
---|
[832] | 132 | # All users CAN ADD COMMENTS |
---|
| 133 | failed_users = [] |
---|
| 134 | for u in self.not_like_anonym: |
---|
| 135 | self.login('dm_admin') |
---|
| 136 | doc_id = "doc_%s" % u |
---|
| 137 | doc_obj = getattr(self.portal, doc_id) |
---|
| 138 | replies_before = self.discussion.getDiscussionFor(doc_obj).getReplies() |
---|
| 139 | self.login(u) |
---|
[880] | 140 | |
---|
[832] | 141 | # Create talkback for document and Add comment |
---|
| 142 | doc_obj.discussion_reply("%s's reply" % u, "text of '%s' reply" % u) |
---|
[880] | 143 | |
---|
[832] | 144 | # Check is comment added |
---|
| 145 | self.login('dm_admin') |
---|
| 146 | replies_after = self.discussion.getDiscussionFor(doc_obj).getReplies() |
---|
| 147 | disparity = len(replies_after) - len(replies_before) |
---|
| 148 | if not disparity: |
---|
| 149 | failed_users.append(u) |
---|
[880] | 150 | self.failIf(failed_users, |
---|
[3114] | 151 | "%s - user(s) can not really add commentin terned OFF " |
---|
| 152 | "*Anonymous commenting mode*." % failed_users) |
---|
[832] | 153 | |
---|
| 154 | |
---|
| 155 | class TestMixinModerationOn: |
---|
| 156 | |
---|
| 157 | def afterSetUp(self): |
---|
[880] | 158 | |
---|
[832] | 159 | # Get Moderation state |
---|
| 160 | pp = getToolByName(self.portal, 'portal_properties') |
---|
[880] | 161 | config_ps = getattr(pp, PROPERTY_SHEET, None) |
---|
[832] | 162 | EnableAnonymComm = getattr(config_ps, "enable_anonymous_commenting") |
---|
[880] | 163 | |
---|
[832] | 164 | # Group users depending on Anonymous commenting enabling/disabling |
---|
| 165 | if EnableAnonymComm: |
---|
| 166 | self.allowable_dm_users = DM_USERS_IDS |
---|
| 167 | self.allowable_common_users = COMMON_USERS_IDS |
---|
| 168 | self.illegal_dm_users = [] |
---|
| 169 | self.illegal_common_users = [] |
---|
| 170 | else: |
---|
| 171 | self.allowable_dm_users = ['dm_admin', 'dm_member'] |
---|
| 172 | self.allowable_common_users = ['admin', 'member'] |
---|
| 173 | self.illegal_dm_users = [u for u in DM_USERS_IDS if not u in self.allowable_dm_users] |
---|
| 174 | self.illegal_common_users = [u for u in COMMON_USERS_IDS if not u in self.allowable_common_users] |
---|
| 175 | |
---|
| 176 | def testAddCommentToNotPublishedReplyDMUsers(self): |
---|
[880] | 177 | |
---|
[832] | 178 | # DiscussionManager's group's members with Manager or Member roles CAN ADD COMMENTS |
---|
| 179 | # to reply IN ANY STATE (published/not published) |
---|
| 180 | failed_users = [] |
---|
| 181 | for u in self.allowable_dm_users: |
---|
| 182 | self.login(u) |
---|
| 183 | doc_obj = getattr(self.portal, "doc_%s" % u) |
---|
| 184 | # Get reply to this document |
---|
| 185 | reply = self.discussion.getDiscussionFor(doc_obj).getReplies()[0] |
---|
| 186 | # Create talkback for reply and Add comment |
---|
| 187 | self.discussion.getDiscussionFor(reply) |
---|
| 188 | reply.discussion_reply("%s's reply" % u, "text of '%s' reply" % u) |
---|
| 189 | replies_to_reply = self.discussion.getDiscussionFor(reply).getReplies() |
---|
| 190 | if not replies_to_reply: |
---|
| 191 | failed_users.append(u) |
---|
[880] | 192 | self.failIf(failed_users, |
---|
[3114] | 193 | "%s - member(s) of DiscussionManager group CAN'T really ADD comment" % failed_users) |
---|
[880] | 194 | |
---|
[832] | 195 | # This is actual only in terned OFF *Anonymous commenting mode* |
---|
| 196 | failed_users = [] |
---|
| 197 | for u in self.illegal_dm_users: |
---|
| 198 | self.login(u) |
---|
| 199 | doc_obj = getattr(self.portal, "doc_%s" % u) |
---|
| 200 | # Get reply to this document |
---|
| 201 | reply = self.discussion.getDiscussionFor(doc_obj).getReplies()[0] |
---|
| 202 | # Create talkback for reply and Add comment |
---|
| 203 | self.discussion.getDiscussionFor(reply) |
---|
| 204 | self.assertRaises(Unauthorized, reply.discussion_reply, "%s's reply" % u, "text of '%s' reply" % u) |
---|
| 205 | replies_to_reply = self.discussion.getDiscussionFor(reply).getReplies() |
---|
| 206 | if replies_to_reply: |
---|
| 207 | failed_users.append(u) |
---|
[880] | 208 | self.failIf(failed_users, |
---|
[3114] | 209 | "%s user(s) CAN really add comment in terned OFF " |
---|
| 210 | "*Anonymous commenting mode*." % failed_users) |
---|
[832] | 211 | |
---|
| 212 | """ |
---|
| 213 | def testAddCommentToNotPublishedReplyNotDMUsers(self): |
---|
| 214 | # Users without DiscussionManager role CAN'T ACCESS an so ADD COMMENTS |
---|
| 215 | # TO NOT PUBLISHED reply. |
---|
| 216 | manager = 'dm_admin' |
---|
| 217 | for u in self.allowable_common_users: |
---|
| 218 | self.login(manager) |
---|
| 219 | doc_obj = getattr(self.portal, "doc_%s" % u) |
---|
| 220 | reply = self.discussion.getDiscussionFor(doc_obj).getReplies()[0] |
---|
| 221 | reply_to_reply = self.discussion.getDiscussionFor(reply).getReplies() |
---|
| 222 | reply_to_reply_before = len(reply_to_reply) |
---|
| 223 | self.logout() |
---|
| 224 | if not u=='anonym': |
---|
| 225 | self.login(u) |
---|
| 226 | # On adding reply to not published reply MUST generte Unauthorized exception |
---|
| 227 | self.assertRaises(Unauthorized, reply.discussion_reply, "Reply %s" % u, "text of %s reply" % u) |
---|
| 228 | """ |
---|
| 229 | |
---|
| 230 | def testAddCommentToPublishedReplyALLUsers(self): |
---|
[880] | 231 | |
---|
[832] | 232 | # All users CAN ADD COMMENTS to published reply |
---|
| 233 | manager = 'dm_admin' |
---|
| 234 | allowable_users = self.allowable_dm_users + self.allowable_common_users |
---|
| 235 | illegal_users = self.illegal_dm_users + self.illegal_common_users |
---|
| 236 | all_users = allowable_users + illegal_users |
---|
[880] | 237 | |
---|
[832] | 238 | # 1. Publish comments |
---|
| 239 | self.login(manager) |
---|
| 240 | for u in all_users: |
---|
| 241 | doc_obj = getattr(self.portal, "doc_%s" % u) |
---|
| 242 | reply = self.discussion.getDiscussionFor(doc_obj).getReplies()[0] |
---|
| 243 | reply.discussion_publish_comment() |
---|
[880] | 244 | |
---|
[832] | 245 | # 2.Check adding reply to reply for allowable users |
---|
| 246 | failed_users = [] |
---|
| 247 | for u in allowable_users: |
---|
| 248 | self.logout() |
---|
| 249 | if not u=='anonym': |
---|
| 250 | self.login(u) |
---|
[880] | 251 | |
---|
[832] | 252 | # Create talkback for document and Add comment |
---|
| 253 | self.discussion.getDiscussionFor(reply) |
---|
| 254 | reply.discussion_reply("Reply %s" % u, "text of %s reply" % u) |
---|
[880] | 255 | |
---|
[832] | 256 | # Check is comment added |
---|
| 257 | self.login(manager) |
---|
| 258 | reply_to_reply = self.discussion.getDiscussionFor(reply).getReplies() |
---|
| 259 | if not reply_to_reply: |
---|
| 260 | failed_users.append(u) |
---|
[880] | 261 | self.failIf(failed_users, |
---|
[3114] | 262 | "%s - user(s) can not really add comment to PUBLISHED reply." % failed_users) |
---|
[880] | 263 | |
---|
[832] | 264 | # 3.Check adding reply to reply for illegal users |
---|
| 265 | for u in illegal_users: |
---|
| 266 | self.logout() |
---|
| 267 | if not u=='anonym': |
---|
| 268 | self.login(u) |
---|
[880] | 269 | |
---|
[832] | 270 | # On adding reply to not published reply MUST generte Unauthorized exception |
---|
| 271 | self.discussion.getDiscussionFor(reply) |
---|
[880] | 272 | self.assertRaises(Unauthorized, reply.discussion_reply, |
---|
[3114] | 273 | "Reply %s" % u, "text of %s reply" % u) |
---|
[832] | 274 | |
---|
| 275 | |
---|
| 276 | class TestMixinModerationOff: |
---|
| 277 | |
---|
| 278 | def afterSetUp(self): |
---|
[880] | 279 | |
---|
[832] | 280 | # Get Moderation state |
---|
| 281 | pp = getToolByName(self.portal, 'portal_properties') |
---|
[880] | 282 | config_ps = getattr(pp, PROPERTY_SHEET, None) |
---|
[832] | 283 | EnableAnonymComm = getattr(config_ps, "enable_anonymous_commenting") |
---|
[880] | 284 | |
---|
[832] | 285 | # Group users depending on Anonymous commenting enabling/disabling |
---|
| 286 | if EnableAnonymComm: |
---|
| 287 | self.allowable_users = DM_USERS_IDS + COMMON_USERS_IDS |
---|
| 288 | self.illegal_users = [] |
---|
| 289 | else: |
---|
| 290 | self.allowable_users = ['dm_admin', 'dm_member', 'admin', 'member'] |
---|
| 291 | self.illegal_users = [u for u in self.all_users_id if not u in self.allowable_users] |
---|
| 292 | |
---|
| 293 | # Add testing document to portal in Moderation OFF mode. |
---|
| 294 | self.discussion = getToolByName(self.portal, 'portal_discussion', None) |
---|
| 295 | self.doc_moder_off_id = 'doc_moderation_off' |
---|
| 296 | self.portal.invokeFactory('Document', id=self.doc_moder_off_id) |
---|
| 297 | doc_obj = getattr(self.portal, self.doc_moder_off_id) |
---|
| 298 | doc_obj.edit(text_format='plain', text='hello world from in moderation off mode') |
---|
[880] | 299 | |
---|
[832] | 300 | # Create talkback for document and Add comment to 'doc_moderatio_off' |
---|
| 301 | self.discussion.getDiscussionFor(doc_obj) |
---|
[880] | 302 | doc_obj.discussion_reply("A Reply to '%s'" % self.doc_moder_off_id, |
---|
[3114] | 303 | "text of reply to '%s'" % self.doc_moder_off_id) |
---|
[832] | 304 | |
---|
| 305 | def testAddCommentToReplyAllowableUsers(self): |
---|
[880] | 306 | |
---|
[832] | 307 | # Users CAN ADD COMMENTS |
---|
| 308 | failed_users = [] |
---|
| 309 | for u in self.allowable_users: |
---|
| 310 | self.logout() |
---|
| 311 | if not u=='anonym': |
---|
| 312 | self.login(u) |
---|
| 313 | doc_obj = getattr(self.portal, self.doc_moder_off_id) |
---|
[880] | 314 | |
---|
[832] | 315 | # Get reply to this document |
---|
| 316 | reply_to_doc = self.discussion.getDiscussionFor(doc_obj).getReplies()[0] |
---|
[880] | 317 | |
---|
[832] | 318 | # Create talkback for reply and Add comment |
---|
| 319 | replies_before = self.discussion.getDiscussionFor(reply_to_doc).getReplies() |
---|
| 320 | if not replies_before: |
---|
| 321 | self.discussion.getDiscussionFor(reply_to_doc) |
---|
| 322 | reply_to_doc.discussion_reply("%s's reply" % u, "text of '%s' reply" % u) |
---|
| 323 | replies_after = self.discussion.getDiscussionFor(reply_to_doc).getReplies() |
---|
| 324 | disparity = len(replies_after) - len(replies_before) |
---|
| 325 | if not disparity: |
---|
| 326 | failed_users.append(u) |
---|
[3116] | 327 | self.failIf(failed_users, |
---|
[3114] | 328 | "%s - member(s) CAN'T really ADD comment in terned off" |
---|
| 329 | " comments Moderation mode." % failed_users) |
---|
[832] | 330 | |
---|
| 331 | def testAddCommentToReplyIllegalUsers(self): |
---|
[880] | 332 | |
---|
[832] | 333 | # This users CAN'T ADD COMMENTS |
---|
| 334 | # This is actual only in terned OFF *Anonymous commenting mode* |
---|
| 335 | for u in self.illegal_users: |
---|
| 336 | self.logout() |
---|
| 337 | if not u=='anonym': |
---|
| 338 | self.login(u) |
---|
| 339 | doc_obj = getattr(self.portal, self.doc_moder_off_id) |
---|
[880] | 340 | |
---|
[832] | 341 | # Get reply to this document |
---|
| 342 | reply_to_doc = self.discussion.getDiscussionFor(doc_obj).getReplies()[0] |
---|
[880] | 343 | |
---|
[832] | 344 | # Create talkback for reply and Add comment |
---|
| 345 | self.discussion.getDiscussionFor(reply_to_doc) |
---|
[880] | 346 | self.assertRaises(Unauthorized, reply_to_doc.discussion_reply, |
---|
[3114] | 347 | "%s's reply" % u, "text of '%s' reply" % u) |
---|
[832] | 348 | |
---|
| 349 | |
---|
| 350 | class TestModerationAnonymComm(TestCommBase, TestMixinAnonymOn, TestMixinModerationOn): |
---|
| 351 | |
---|
| 352 | def afterSetUp(self): |
---|
| 353 | TestCommBase.afterSetUp(self) |
---|
[880] | 354 | |
---|
[832] | 355 | # Preparation for functional testing |
---|
| 356 | # Tern On Moderation and tern on Anonymous commenting |
---|
| 357 | self.request.form['enable_anonymous_commenting'] = 'True' |
---|
| 358 | self.request.form['enable_moderation'] = 'True' |
---|
| 359 | self.portal.prefs_comments_setup() |
---|
[880] | 360 | |
---|
[832] | 361 | # Initialize base classes |
---|
| 362 | TestMixinAnonymOn.afterSetUp(self) |
---|
| 363 | TestMixinModerationOn.afterSetUp(self) |
---|
| 364 | |
---|
| 365 | |
---|
| 366 | class TestModerationOFFAnonymComm(TestCommBase, TestMixinAnonymOff, TestMixinModerationOn): |
---|
| 367 | |
---|
| 368 | def afterSetUp(self): |
---|
| 369 | TestCommBase.afterSetUp(self) |
---|
[880] | 370 | |
---|
[832] | 371 | # Preparation for functional testing |
---|
| 372 | # Tern On Moderation and tern off Anonymous commenting |
---|
| 373 | self.request.form['enable_moderation'] = 'True' |
---|
| 374 | self.portal.prefs_comments_setup() |
---|
[880] | 375 | |
---|
[832] | 376 | # Initialize base classes |
---|
| 377 | TestMixinAnonymOff.afterSetUp(self) |
---|
| 378 | TestMixinModerationOn.afterSetUp(self) |
---|
| 379 | |
---|
| 380 | |
---|
| 381 | class TestAnonymCommOFFModeration(TestCommBase, TestMixinAnonymOn, TestMixinModerationOff): |
---|
| 382 | |
---|
| 383 | def afterSetUp(self): |
---|
| 384 | TestCommBase.afterSetUp(self) |
---|
[880] | 385 | |
---|
[832] | 386 | # Preparation for functional testing |
---|
| 387 | # Tern On Anonymous commenting and tern off Moderation |
---|
| 388 | self.request.form['enable_anonymous_commenting'] = 'True' |
---|
| 389 | self.portal.prefs_comments_setup() |
---|
[880] | 390 | |
---|
[832] | 391 | # Initialize base classes |
---|
| 392 | TestMixinAnonymOn.afterSetUp(self) |
---|
| 393 | TestMixinModerationOff.afterSetUp(self) |
---|
| 394 | |
---|
| 395 | |
---|
| 396 | class TestOFFModerationOFFAnonymComm(TestCommBase, TestMixinAnonymOff, TestMixinModerationOff): |
---|
| 397 | |
---|
| 398 | def afterSetUp(self): |
---|
| 399 | TestCommBase.afterSetUp(self) |
---|
[880] | 400 | |
---|
[832] | 401 | # Preparation for functional testing |
---|
| 402 | # Tern Off Moderation and tern off Anonymous commenting |
---|
| 403 | self.portal.prefs_comments_setup() |
---|
[880] | 404 | |
---|
[832] | 405 | # Initialize base classes |
---|
| 406 | TestMixinAnonymOff.afterSetUp(self) |
---|
| 407 | TestMixinModerationOff.afterSetUp(self) |
---|
| 408 | |
---|
| 409 | |
---|
| 410 | def test_suite(): |
---|
| 411 | from unittest import TestSuite, makeSuite |
---|
| 412 | suite = TestSuite() |
---|
| 413 | suite.addTest(makeSuite(TestModerationAnonymComm)) |
---|
| 414 | suite.addTest(makeSuite(TestModerationOFFAnonymComm)) |
---|
| 415 | suite.addTest(makeSuite(TestAnonymCommOFFModeration)) |
---|
| 416 | suite.addTest(makeSuite(TestOFFModerationOFFAnonymComm)) |
---|
| 417 | |
---|
| 418 | return suite |
---|