def test_record_activity_on_decide_a_proposal_for_proposal_and_submitted_proposal( self, browser): self.login(self.committee_responsible, browser) decided_activities = self.query_activities( 'proposal-transition-decide') proposal = self.create_proposal_with_issuer(self.dossier_responsible, self.committee, browser) submitted_proposal = self.submit_proposal(proposal, browser) agenda_item = self.schedule_proposal(self.meeting, submitted_proposal) agenda_item.decide() excerpt = agenda_item.generate_excerpt('Foo') self.assertEqual(0, decided_activities.count()) submitted_proposal.load_model().decide(agenda_item, excerpt) self.assertEqual(2, decided_activities.count()) for activity in decided_activities.all(): self.assertEquals('proposal-transition-decide', activity.kind) self.assertEquals('Proposal decided', activity.label) self.assertEquals(proposal.title, activity.title) self.assertEquals(u'Proposal decided by {}'.format(actor_link()), activity.summary) users = [self.dossier_responsible] self.assertBadgeNotificationsForUsers(users, u'proposal-transition-decide')
def test_record_activity_on_comment_for_proposal_and_submitted_proposal( self, browser): self.login(self.manager, browser) committee_group_id = self.committee.load_model().group_id commented_activities = self.query_activities('proposal-commented') self.assertEqual(0, commented_activities.count()) proposal = self.create_proposal_with_issuer(self.dossier_responsible, self.committee, browser) self.submit_proposal(proposal, browser) proposal.comment(u'james b\xc3\xb6nd') self.assertEqual(2, commented_activities.count()) for activity in commented_activities.all(): self.assertEquals('proposal-commented', activity.kind) self.assertEquals(proposal.title, activity.title) self.assertEquals(u'Proposal commented by {}'.format(actor_link()), activity.summary) self.assertEqual( [u'Proposal commented', u'Submitted proposal commented'], [activity.label for activity in commented_activities.all()]) users = self.get_group_members(committee_group_id) + [ self.dossier_responsible ] self.assertBadgeNotificationsForUsers(users, u'proposal-commented')
def test_record_activity_on_schedule_a_proposal_for_proposal_and_submitted_proposal( self, browser): self.login(self.manager, browser) scheduled_activities = self.query_activities( 'proposal-transition-schedule') meeting = self.meeting.model proposal = self.create_proposal_with_issuer(self.dossier_responsible, self.committee, browser) submitted_proposal = self.submit_proposal(proposal, browser) self.assertEqual(0, scheduled_activities.count()) submitted_proposal.load_model().schedule(meeting) self.assertEqual(2, scheduled_activities.count()) for activity in scheduled_activities.all(): self.assertEquals('proposal-transition-schedule', activity.kind) self.assertEquals('Proposal scheduled', activity.label) self.assertEquals(proposal.title, activity.title) self.assertEquals( u'Scheduled for meeting {} by {}'.format( meeting.get_title(), actor_link()), activity.summary) users = [self.dossier_responsible] self.assertBadgeNotificationsForUsers(users, u'proposal-transition-schedule')
def test_record_activity_on_rejecting_a_proposal_for_proposal_and_submitted_proposal( self, browser): self.login(self.manager, browser) rejected_activities = self.query_activities( 'proposal-transition-reject') proposal = self.create_proposal_with_issuer(self.dossier_responsible, self.committee, browser) submitted_proposal = self.submit_proposal(proposal, browser) self.assertEqual(0, rejected_activities.count()) self.reject_proposal(submitted_proposal, browser) self.assertEqual(2, rejected_activities.count()) for activity in rejected_activities.all(): self.assertEquals('proposal-transition-reject', activity.kind) self.assertEquals('Proposal rejected', activity.label) self.assertEquals(proposal.title, activity.title) self.assertEquals(u'Rejected by {}'.format(actor_link()), activity.summary) users = [self.dossier_responsible] self.assertBadgeNotificationsForUsers(users, u'proposal-transition-reject')
def test_record_activity_on_submtitting_a_proposal_for_proposal_and_submitted_proposal( self, browser): self.login(self.manager, browser) committee_group_id = self.committee.load_model().group_id submitted_activities = self.query_activities( 'proposal-transition-submit') proposal = self.create_proposal_with_issuer(self.dossier_responsible, self.committee, browser) self.assertEqual(0, submitted_activities.count()) self.submit_proposal(proposal, browser) self.assertEqual(2, submitted_activities.count()) for activity in submitted_activities.all(): self.assertEquals('proposal-transition-submit', activity.kind) self.assertEquals('Proposal submitted', activity.label) self.assertEquals(proposal.title, activity.title) self.assertEquals(u'Submitted by {}'.format(actor_link()), activity.summary) users = self.get_group_members(committee_group_id) self.assertBadgeNotificationsForUsers(users, u'proposal-transition-submit')
def summary(self): return self.translate_to_all_languages( _('proposal_history_label_remove_scheduled', u'Removed from schedule of meeting ${meeting} by ${user}', mapping={'meeting': self.get_meeting_title(self.meeting_id), 'user': actor_link()}))
def summary(self): return self.translate_to_all_languages( _('proposal_history_label_rejected', u'Rejected by ${user}', mapping={'user': actor_link()}))