Beispiel #1
0
    def test_deleted_activity(self):
        document = create(Builder('document').titled('The Document'))
        with freeze(datetime(2010, 12, 25, 13, 30)):
            record_id = object_deleted(document)
        record = get_activity_soup().get(record_id)

        self.assertEquals({'path': '/plone/the-document',
                           'allowed_roles_and_users': ['Anonymous'],
                           'uuid': 'testdeletedactivity0000000000001',
                           'portal_type': 'Document',
                           'title': 'The Document',
                           'timestamp': 1293280200000L,
                           'action': 'deleted',
                           'date': DateTime('2010/12/25 13:30:00'),
                           'actor': TEST_USER_ID},
                          dict(record.attrs))
Beispiel #2
0
def make_object_deleted_activity(context, event):
    # When deleting the Plone Site, getSite() is None
    # and we can abort recording activities.
    if getSite() is None:
        return None
    object_deleted(context)