def test_restore_object(self): doc = api.content.create(type='Document', id='doc1', container=self.portal) trash.object(doc) self.assertTrue(ITrashed.providedBy(doc)) trash.restore(doc) self.assertFalse(ITrashed.providedBy(doc))
def handle_move(self, action): title = safe_unicode(self.context.Title()) parent = aq_parent(aq_inner(self.context)) # has the context object been acquired from a place it should not have # been? if self.context.aq_chain == self.context.aq_inner.aq_chain: trash.object(self.context) IStatusMessage(self.request).add( u'%s has been moved to recycle bin.' % title) self.request.response.redirect(parent.absolute_url())
def action(self, obj): trash.object(obj)