Esempio n. 1
0
    def test_comment_removed_activity(self):
        document = create(Builder('document').titled('The Document'))
        conversation = IConversation(document)

        comment = createObject('plone.Comment')
        comment.text = 'Comment text'
        comment_id = conversation.addComment(comment)

        with freeze(datetime(2010, 12, 25, 13, 30)):
            record_id = comment_removed(document, comment)
        record = get_activity_soup().get(record_id)

        self.assertEquals({'path': '/plone/the-document',
                           'allowed_roles_and_users': ['Anonymous'],
                           'uuid': 'testcommentremovedactivity000001',
                           'portal_type': 'Document',
                           'title': 'The Document',
                           'timestamp': 1293280200000L,
                           'action': 'comment:removed',
                           'date': DateTime('2010/12/25 13:30:00'),
                           'actor': TEST_USER_ID,
                           'comment_id': comment_id,
                           'comment_text': 'Comment text',
                           'comment_text_mime_type': 'text/plain'},
                          dict(record.attrs))
Esempio n. 2
0
def make_comment_removed_activity(context, event):
    comment_removed(context, event.comment)
Esempio n. 3
0
def make_comment_removed_activity(context, event):
    if not is_supported(context):
        return None

    comment_removed(context, event.comment)