def test_appraise_activity_is_recorded(self): self.login(self.archivist) actor = ActorLookup(self.archivist.getId()).lookup() disposition = create(Builder('disposition')) api.content.transition(disposition, transition='disposition-transition-appraise') activity = Activity.query.all()[-1] self.assertEquals('disposition-transition-appraise', activity.kind) self.assertEquals( u'Appraisal finalized by {}'.format(actor.get_link()), activity.summary) self.assertEquals(u'disposition-transition-appraise', activity.label) self.assertIsNone(activity.description)
def test_appraise_activity_is_recorded(self): self.login(self.archivist) actor = ActorLookup(self.archivist.getId()).lookup() disposition = create(Builder('disposition')) api.content.transition(disposition, transition='disposition-transition-appraise') activity = Activity.query.all()[-1] self.assertEquals('disposition-transition-appraise', activity.kind) self.assertEquals( u'Appraisal finalized by {}'.format(actor.get_link()), activity.summary) self.assertEquals(u'disposition-transition-appraise', activity.label) self.assertIsNone(activity.description)
def test_close_activity_is_recorded(self): self.login(self.records_manager) actor = ActorLookup(self.records_manager.getId()).lookup() disposition = create( Builder('disposition').in_state('disposition-state-archived')) api.content.transition(disposition, transition='disposition-transition-close') activity = Activity.query.all()[-1] self.assertEquals('disposition-transition-close', activity.kind) self.assertEquals( u'Disposition closed and all dossiers ' 'destroyed by {}'.format(actor.get_link()), activity.summary) self.assertEquals(u'disposition-transition-close', activity.label) self.assertIsNone(activity.description)
def test_close_activity_is_recorded(self): self.login(self.records_manager) actor = ActorLookup(self.records_manager.getId()).lookup() disposition = create(Builder('disposition') .in_state('disposition-state-archived')) api.content.transition(disposition, transition='disposition-transition-close') activity = Activity.query.all()[-1] self.assertEquals('disposition-transition-close', activity.kind) self.assertEquals( u'Disposition closed and all dossiers ' 'destroyed by {}'.format(actor.get_link()), activity.summary) self.assertEquals(u'disposition-transition-close', activity.label) self.assertIsNone(activity.description)
def test_dispose_activity_is_recorded(self): self.login(self.records_manager) actor = ActorLookup(self.records_manager.getId()).lookup() ILifeCycle(self.expired_dossier).archival_value = ARCHIVAL_VALUE_WORTHY disposition = create( Builder('disposition').having(dossiers=[self.expired_dossier]). in_state('disposition-state-appraised')) api.content.transition(disposition, transition='disposition-transition-dispose') activity = Activity.query.all()[-1] self.assertEquals('disposition-transition-dispose', activity.kind) self.assertEquals( u'Disposition disposed for the archive by {}'.format( actor.get_link()), activity.summary) self.assertEquals(u'disposition-transition-dispose', activity.label) self.assertIsNone(activity.description)
def test_dispose_activity_is_recorded(self): self.login(self.records_manager) actor = ActorLookup(self.records_manager.getId()).lookup() ILifeCycle(self.expired_dossier).archival_value = ARCHIVAL_VALUE_WORTHY disposition = create(Builder('disposition') .having(dossiers=[self.expired_dossier]) .in_state('disposition-state-appraised')) api.content.transition(disposition, transition='disposition-transition-dispose') activity = Activity.query.all()[-1] self.assertEquals('disposition-transition-dispose', activity.kind) self.assertEquals( u'Disposition disposed for the archive by {}'.format(actor.get_link()), activity.summary) self.assertEquals(u'disposition-transition-dispose', activity.label) self.assertIsNone(activity.description)
def current_user_link(self): userid = api.user.get_current().getId() actor = ActorLookup(userid).lookup() return actor.get_link()
def current_user_link(self): userid = api.user.get_current().getId() actor = ActorLookup(userid).lookup() return actor.get_link()