def test_assigned_activity_is_recorded_when_a_todo_with_responsible_is_created( self): self.login(self.workspace_owner) create( Builder('todo').titled(u'Test ToDos').having( responsible=self.workspace_member.getId()).within( self.workspace)) activity = Activity.query.one() self.assertEquals('todo-assigned', activity.kind) self.assertEquals(u'ToDo assigned', activity.label) self.assertIsNone(activity.description) self.assertEquals(u'Test ToDos', activity.title) user = ActorLookup(self.workspace_owner.getId()).lookup() responsible = ActorLookup(self.workspace_member.getId()).lookup() self.assertEquals( u'Assigned to {} by {}'.format( responsible.get_label(with_principal=False), user.get_label(with_principal=False)), activity.summary)
def test_assigned_activity_is_recorded_when_a_todo_is_reassigned( self, browser): self.login(self.workspace_owner, browser) browser.open(self.assigned_todo, method='PATCH', headers=self.api_headers, data=json.dumps( {'responsible': self.workspace_guest.getId()})) activity = Activity.query.one() self.assertEquals('todo-assigned', activity.kind) self.assertEquals(u'ToDo assigned', activity.label) self.assertIsNone(activity.description) self.assertEquals(u'Go live', activity.title) user = ActorLookup(self.workspace_owner.getId()).lookup() responsible = ActorLookup(self.workspace_guest.getId()).lookup() self.assertEquals( u'Assigned to {} by {}'.format( responsible.get_label(with_principal=False), user.get_label(with_principal=False)), activity.summary)
def test_added_activity_is_recorded_when_a_disposition_is_created(self): self.login(self.regular_user) actor = ActorLookup(self.regular_user.getId()).lookup() create(Builder('disposition').titled(u'Angebot 13.49')) activity = Activity.query.one() self.assertEquals('disposition-added', activity.kind) self.assertEquals( u'New disposition added by {} on admin unit Hauptmandant'.format( actor.get_label(with_principal=False)), activity.summary) self.assertEquals(u'Disposition added', activity.label) self.assertIsNone(activity.description) self.assertEquals(u'Angebot 13.49', activity.title)
def test_added_activity_is_recorded_when_a_disposition_is_created(self): self.login(self.regular_user) actor = ActorLookup(self.regular_user.getId()).lookup() create(Builder('disposition').titled(u'Angebot 13.49')) activity = Activity.query.one() self.assertEquals('disposition-added', activity.kind) self.assertEquals( u'New disposition added by {} on admin unit Hauptmandant'.format( actor.get_label(with_principal=False)), activity.summary) self.assertEquals(u'Disposition added', activity.label) self.assertIsNone(activity.description) self.assertEquals(u'Angebot 13.49', activity.title)
def test_closed_activity_is_recorded_when_a_todo_is_closed(self, browser): self.login(self.workspace_owner, browser) browser.open(self.assigned_todo, method='PATCH', headers=self.api_headers, data=json.dumps({'completed': True})) activity = Activity.query.one() self.assertEquals('todo-modified', activity.kind) self.assertEquals(u'ToDo closed', activity.label) self.assertIsNone(activity.description) self.assertEquals(u'Go live', activity.title) user = ActorLookup(self.workspace_owner.getId()).lookup() self.assertEquals( u'Closed by {}'.format(user.get_label(with_principal=False)), activity.summary)
def test_commented_activity_is_recorded_when_a_todo_is_commented( self, browser): self.login(self.workspace_member, browser) url = '{}/@responses'.format(self.todo.absolute_url()) browser.open(url, method="POST", headers=self.api_headers, data=json.dumps({'text': u'Angebot \xfcberpr\xfcft'})) activity = Activity.query.one() self.assertEquals('todo-modified', activity.kind) self.assertEquals(u'ToDo commented', activity.label) self.assertIsNone(activity.description) self.assertEquals('Fix user login', activity.title) user = ActorLookup(self.workspace_member.getId()).lookup() self.assertEquals( u'Commented by {}'.format(user.get_label(with_principal=False)), activity.summary)
def archivist_label(self): userid = self.archivist.getId() actor = ActorLookup(userid).lookup() return actor.get_label()
def records_manager_label(self): userid = self.records_manager.getId() actor = ActorLookup(userid).lookup() return actor.get_label()
def archivist_label(self): userid = self.archivist.getId() actor = ActorLookup(userid).lookup() return actor.get_label()
def records_manager_label(self): userid = self.records_manager.getId() actor = ActorLookup(userid).lookup() return actor.get_label()