diff --git a/plone/app/discussion/tests/test_comment.py b/plone/app/discussion/tests/test_comment.py index 1ee7903..cc115a1 100644 --- a/plone/app/discussion/tests/test_comment.py +++ b/plone/app/discussion/tests/test_comment.py @@ -99,7 +99,6 @@ class CommentTest(PloneTestCase): conversation = IConversation(self.portal.doc1) comment1 = createObject('plone.Comment') - comment1.title = 'Comment 1' comment1.text = 'Comment text' new_comment1_id = conversation.addComment(comment1) @@ -107,7 +106,6 @@ class CommentTest(PloneTestCase): comment = self.portal.doc1.restrictedTraverse( '++conversation++default/%s' % new_comment1_id) self.assert_(IComment.providedBy(comment)) - self.assertEquals('Comment 1', comment.title) self.assertEquals(('', 'plone', 'doc1', '++conversation++default', str(new_comment1_id)), comment.getPhysicalPath()) @@ -160,7 +158,6 @@ class CommentTest(PloneTestCase): # Create a comment comment1 = createObject('plone.Comment') - comment1.title = 'Comment 1' comment1.text = 'Comment text' # Add comment to the conversation @@ -204,7 +201,6 @@ class RepliesTest(PloneTestCase): replies = IReplies(conversation) comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' new_id = replies.addComment(comment) comment = self.portal.doc1.restrictedTraverse( @@ -212,7 +208,6 @@ class RepliesTest(PloneTestCase): # Add a reply to the CommentReplies adapter of the first comment re_comment = createObject('plone.Comment') - re_comment.title = 'Re: Comment 1' re_comment.text = 'Comment text' replies = IReplies(comment) @@ -242,7 +237,6 @@ class RepliesTest(PloneTestCase): replies = IReplies(conversation) comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' new_id = replies.addComment(comment) comment = self.portal.doc1.restrictedTraverse( @@ -250,7 +244,6 @@ class RepliesTest(PloneTestCase): # Add a reply to the CommentReplies adapter of the first comment re_comment = createObject('plone.Comment') - re_comment.title = 'Re: Comment 1' re_comment.text = 'Comment text' replies = IReplies(comment) @@ -274,13 +267,11 @@ class RepliesTest(PloneTestCase): conversation = IConversation(self.portal.doc1) comment1 = createObject('plone.Comment') - comment1.title = 'Comment 1' comment1.text = 'Comment text' conversation.addComment(comment1) comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' new_id = conversation.addComment(comment) comment = self.portal.doc1.restrictedTraverse( @@ -288,7 +279,6 @@ class RepliesTest(PloneTestCase): # Add a reply to the CommentReplies adapter of the first comment re_comment = createObject('plone.Comment') - re_comment.title = 'Re: Comment 1' re_comment.text = 'Comment text' replies = IReplies(comment) new_re_id = replies.addComment(re_comment) @@ -297,7 +287,6 @@ class RepliesTest(PloneTestCase): # Add a reply to the reply re_re_comment = createObject('plone.Comment') - re_re_comment.title = 'Re: Re: Comment 1' re_re_comment.text = 'Comment text' replies = IReplies(re_comment) new_re_re_id = replies.addComment(re_re_comment) @@ -306,7 +295,6 @@ class RepliesTest(PloneTestCase): # Add a reply to the replies reply re_re_re_comment = createObject('plone.Comment') - re_re_re_comment.title = 'Re: Re: Comment 1' re_re_re_comment.text = 'Comment text' replies = IReplies(re_re_comment) new_re_re_re_id = replies.addComment(re_re_re_comment) diff --git a/plone/app/discussion/tests/test_conversation.py b/plone/app/discussion/tests/test_conversation.py index e5060e2..0e755a9 100644 --- a/plone/app/discussion/tests/test_conversation.py +++ b/plone/app/discussion/tests/test_conversation.py @@ -42,7 +42,6 @@ class ConversationTest(PloneTestCase): # factory to allow different factories to be swapped in comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' new_id = conversation.addComment(comment) @@ -68,7 +67,6 @@ class ConversationTest(PloneTestCase): # factory to allow different factories to be swapped in comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' new_id = conversation.addComment(comment) @@ -105,27 +103,21 @@ class ConversationTest(PloneTestCase): # Create all comments comment1 = createObject('plone.Comment') - comment1.title = 'Comment 1' comment1.text = 'Comment text' comment1_1 = createObject('plone.Comment') - comment1_1.title = 'Re: Comment 1' comment1_1.text = 'Comment text' comment1_1_1 = createObject('plone.Comment') - comment1_1_1.title = 'Re: Re: Comment 1' comment1_1_1.text = 'Comment text' comment1_2 = createObject('plone.Comment') - comment1_2.title = 'Re: Comment 1 (2)' comment1_2.text = 'Comment text' comment2 = createObject('plone.Comment') - comment2.title = 'Comment 2' comment2.text = 'Comment text' comment2_1 = createObject('plone.Comment') - comment2_1.title = 'Re: Comment 2' comment2_1.text = 'Comment text' # Create the nested comment structure @@ -156,7 +148,6 @@ class ConversationTest(PloneTestCase): # object itself is deleted. conversation = IConversation(self.portal.doc1) comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' conversation.addComment(comment) @@ -418,13 +409,11 @@ class ConversationTest(PloneTestCase): # factory to allow different factories to be swapped in comment1 = createObject('plone.Comment') - comment1.title = 'Comment 1' comment1.text = 'Comment text' new_id1 = conversation.addComment(comment1) comment2 = createObject('plone.Comment') - comment2.title = 'Comment 2' comment2.text = 'Comment text' new_id2 = conversation.addComment(comment2) @@ -477,15 +466,12 @@ class ConversationTest(PloneTestCase): # swapped in comment1 = createObject('plone.Comment') - comment1.title = 'Comment 1' comment1.text = 'Comment text' comment2 = createObject('plone.Comment') - comment2.title = 'Comment 2' comment2.text = 'Comment text' comment3 = createObject('plone.Comment') - comment3.title = 'Comment 3' comment3.text = 'Comment text' conversation.addComment(comment1) @@ -509,25 +495,21 @@ class ConversationTest(PloneTestCase): # comments via the factory to allow different factories to be # swapped in comment1 = createObject('plone.Comment') - comment1.title = 'Comment 1' comment1.text = 'Comment text' comment1.author_username = "Jim" conversation.addComment(comment1) comment2 = createObject('plone.Comment') - comment2.title = 'Comment 2' comment2.text = 'Comment text' comment2.author_username = "Joe" conversation.addComment(comment2) comment3 = createObject('plone.Comment') - comment3.title = 'Comment 3' comment3.text = 'Comment text' comment3.author_username = "Jack" new_comment3_id = conversation.addComment(comment3) comment4 = createObject('plone.Comment') - comment4.title = 'Comment 3' comment4.text = 'Comment text' comment4.author_username = "Jack" new_comment4_id = conversation.addComment(comment4) @@ -570,19 +552,16 @@ class ConversationTest(PloneTestCase): # comments via the factory to allow different factories to be # swapped in comment1 = createObject('plone.Comment') - comment1.title = 'Comment 1' comment1.text = 'Comment text' comment1.creation_date = datetime.utcnow() - timedelta(4) conversation.addComment(comment1) comment2 = createObject('plone.Comment') - comment2.title = 'Comment 2' comment2.text = 'Comment text' comment2.creation_date = datetime.utcnow() - timedelta(2) new_comment2_id = conversation.addComment(comment2) comment3 = createObject('plone.Comment') - comment3.title = 'Comment 3' comment3.text = 'Comment text' comment3.creation_date = datetime.utcnow() - timedelta(1) new_comment3_id = conversation.addComment(comment3) @@ -639,27 +618,21 @@ class ConversationTest(PloneTestCase): # Create all comments comment1 = createObject('plone.Comment') - comment1.title = 'Comment 1' comment1.text = 'Comment text' comment1_1 = createObject('plone.Comment') - comment1_1.title = 'Re: Comment 1' comment1_1.text = 'Comment text' comment1_1_1 = createObject('plone.Comment') - comment1_1_1.title = 'Re: Re: Comment 1' comment1_1_1.text = 'Comment text' comment1_2 = createObject('plone.Comment') - comment1_2.title = 'Re: Comment 1 (2)' comment1_2.text = 'Comment text' comment2 = createObject('plone.Comment') - comment2.title = 'Comment 2' comment2.text = 'Comment text' comment2_1 = createObject('plone.Comment') - comment2_1.title = 'Re: Comment 2' comment2_1.text = 'Comment text' # Create the nested comment structure @@ -751,7 +724,6 @@ class RepliesTest(PloneTestCase): replies = IReplies(conversation) comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' new_id = replies.addComment(comment) @@ -779,7 +751,6 @@ class RepliesTest(PloneTestCase): # Add a comment. comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' new_id = replies.addComment(comment) @@ -819,27 +790,21 @@ class RepliesTest(PloneTestCase): # Create all comments comment1 = createObject('plone.Comment') - comment1.title = 'Comment 1' comment1.text = 'Comment text' comment1_1 = createObject('plone.Comment') - comment1_1.title = 'Re: Comment 1' comment1_1.text = 'Comment text' comment1_1_1 = createObject('plone.Comment') - comment1_1_1.title = 'Re: Re: Comment 1' comment1_1_1.text = 'Comment text' comment1_2 = createObject('plone.Comment') - comment1_2.title = 'Re: Comment 1 (2)' comment1_2.text = 'Comment text' comment2 = createObject('plone.Comment') - comment2.title = 'Comment 2' comment2.text = 'Comment text' comment2_1 = createObject('plone.Comment') - comment2_1.title = 'Re: Comment 2' comment2_1.text = 'Comment text' # Create the nested comment structure diff --git a/plone/app/discussion/tests/test_moderation_view.py b/plone/app/discussion/tests/test_moderation_view.py index aabd538..634bdff 100644 --- a/plone/app/discussion/tests/test_moderation_view.py +++ b/plone/app/discussion/tests/test_moderation_view.py @@ -216,7 +216,7 @@ class ModerationBulkActionsViewTest(PloneTestCase): self.assertEquals(self.conversation.total_comments, 1) comment = self.conversation.getComments().next() self.failUnless(comment) - self.assertEquals(comment.title, 'Comment 2') + self.assertEquals(comment, self.comment2) def test_suite(): return unittest.defaultTestLoader.loadTestsFromName(__name__) diff --git a/plone/app/discussion/tests/test_notifications.py b/plone/app/discussion/tests/test_notifications.py index 404ebac..baa00e3 100644 --- a/plone/app/discussion/tests/test_notifications.py +++ b/plone/app/discussion/tests/test_notifications.py @@ -57,14 +57,12 @@ class TestUserNotificationUnit(PloneTestCase): # Add a comment with user notification enabled. Add another comment # and make sure an email is send to the user of the first comment. comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' comment.user_notification = True comment.author_email = "john@plone.test" self.conversation.addComment(comment) comment = createObject('plone.Comment') - comment.title = 'Comment 2' comment.text = 'Comment text' self.conversation.addComment(comment) self.assertEquals(len(self.mailhost.messages), 1) @@ -91,14 +89,12 @@ class TestUserNotificationUnit(PloneTestCase): 'user_notification_enabled'] = False comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' comment.user_notification = True comment.author_email = "john@plone.test" self.conversation.addComment(comment) comment = createObject('plone.Comment') - comment.title = 'Comment 2' comment.text = 'Comment text' self.conversation.addComment(comment) @@ -106,13 +102,11 @@ class TestUserNotificationUnit(PloneTestCase): def test_do_not_notify_user_when_email_address_is_given(self): comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' comment.user_notification = True self.conversation.addComment(comment) comment = createObject('plone.Comment') - comment.title = 'Comment 2' comment.text = 'Comment text' self.conversation.addComment(comment) @@ -124,14 +118,12 @@ class TestUserNotificationUnit(PloneTestCase): self.portal.email_from_address = None comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' comment.user_notification = True comment.author_email = "john@plone.test" self.conversation.addComment(comment) comment = createObject('plone.Comment') - comment.title = 'Comment 2' comment.text = 'Comment text' self.conversation.addComment(comment) @@ -181,7 +173,6 @@ class TestModeratorNotificationUnit(PloneTestCase): def test_notify_moderator(self): # Add a comment and make sure an email is send to the moderator. comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' self.conversation.addComment(comment) @@ -215,7 +206,6 @@ class TestModeratorNotificationUnit(PloneTestCase): self.portal.email_from_address = None comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' self.conversation.addComment(comment) self.assertEquals(len(self.mailhost.messages), 0) @@ -228,7 +218,6 @@ class TestModeratorNotificationUnit(PloneTestCase): 'moderator_notification_enabled'] = False comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' self.conversation.addComment(comment) self.assertEquals(len(self.mailhost.messages), 0) @@ -242,7 +231,6 @@ class TestModeratorNotificationUnit(PloneTestCase): ('one_state_workflow',)) comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' self.conversation.addComment(comment) self.assertEquals(len(self.mailhost.messages), 0) diff --git a/plone/app/discussion/tests/test_tool.py b/plone/app/discussion/tests/test_tool.py index 7737854..3321ddb 100644 --- a/plone/app/discussion/tests/test_tool.py +++ b/plone/app/discussion/tests/test_tool.py @@ -25,7 +25,6 @@ class ToolTest(PloneTestCase): # Add a comment. comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.creator = 'Jim' comment.text = 'Comment text' diff --git a/plone/app/discussion/tests/test_workflow.py b/plone/app/discussion/tests/test_workflow.py index 5fdf452..e1fd408 100644 --- a/plone/app/discussion/tests/test_workflow.py +++ b/plone/app/discussion/tests/test_workflow.py @@ -78,7 +78,6 @@ class CommentOneStateWorkflowTest(PloneTestCase): # Add a comment conversation = IConversation(self.folder.doc1) comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' cid = conversation.addComment(comment) @@ -146,7 +145,6 @@ class CommentReviewWorkflowTest(PloneTestCase): # Add a comment. comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' comment_id = conversation.addComment(comment) comment = self.portal.doc1.restrictedTraverse(