def test_manual_excerpt_can_be_generated(self, browser): browser.login().open(self.meeting.get_url()) browser.css('.generate-excerpt').first.click() browser.fill({ 'agenda_item-1.include:record': True, 'Target dossier': self.dossier }) browser.find('Save').click() self.assertEqual([ u'Excerpt for meeting C\xf6mmunity meeting has ' 'been generated successfully' ], info_messages()) # refresh meeting = Meeting.get(self.meeting.meeting_id) self.assertEqual(1, len(meeting.excerpt_documents)) document = meeting.excerpt_documents[0] self.assertEqual(0, document.generated_version) self.assertEqual(self.meeting.get_url(), browser.url, 'should be on meeting view') self.assertEqual(1, len(browser.css('.excerpts li a.document_link')), 'generated document should be linked') self.assertEqual([u'Protocol Excerpt-C\xf6mmunity meeting'], browser.css('.excerpts li a.document_link').text)
def test_fills_decision_with_decision_draft_value(self, browser): proposal = self.setup_proposal() view = 'unscheduled_proposals/{}/schedule'.format( proposal.load_model().proposal_id) browser.login().open(self.meeting_wrapper, view=view) agenda_items = Meeting.get(self.meeting.meeting_id).agenda_items self.assertEquals(u'<div>Project allowed.</div>',agenda_items[0].decision)
def get_meeting(self): meeting_id = self.request.get('meeting-id') if not meeting_id: raise NotFound meeting = Meeting.get(meeting_id) if not meeting: raise NotFound return meeting
def test_schedule_text(self, browser): browser.login().open(self.meeting_wrapper, view='agenda_items/schedule_text', data={'title': u'Baugesuch Herr Maier'}) agenda_items = Meeting.get(self.meeting.meeting_id).agenda_items self.assertEquals(1, len(agenda_items)) self.assertEqual(u'Baugesuch Herr Maier', agenda_items[0].title) self.assertFalse(agenda_items[0].is_paragraph)
def test_schedule_paragraph(self, browser): browser.login().open(self.meeting_wrapper, view='agenda_items/schedule_paragraph', data={'title': 'Abschnitt A'}) agenda_items = Meeting.get(self.meeting.meeting_id).agenda_items self.assertEquals(1, len(agenda_items)) self.assertEqual(u'Abschnitt A', agenda_items[0].title) self.assertTrue(agenda_items[0].is_paragraph)
def test_generated_protocol_can_be_updated(self, browser): self.setup_generated_protocol(browser) browser.open(self.meeting.get_url()) browser.css('a[href*="@@update_protocol"]').first.click() meeting = Meeting.get(self.meeting.meeting_id) # refresh meeting generated_document = meeting.protocol_document self.assertIsNotNone(generated_document) self.assertEqual(1, generated_document.generated_version) self.assertEqual(meeting, generated_document.meeting) self.assertEqual(1, GeneratedProtocol.query.count())
def test_schedules_proposal(self, browser): proposal = self.setup_proposal() view = 'unscheduled_proposals/{}/schedule'.format( proposal.load_model().proposal_id) browser.login().open(self.meeting_wrapper, view=view) agenda_items = Meeting.get(self.meeting.meeting_id).agenda_items self.assertEquals(1, len(agenda_items)) self.assertTrue(agenda_items[0].has_proposal) self.assertEqual(proposal.load_model(), agenda_items[0].proposal) self.assertEqual([{u'messageTitle': u'Information', u'message': u'Scheduled Successfully', u'messageClass': u'info'}], browser.json.get('messages'))
def test_protocol_can_be_generated(self, browser): self.setup_protocol(browser) browser.css('a[href*="@@generate_protocol"]').first.click() self.assertEquals([ 'Protocol for meeting My meeting ' 'has been generated successfully.' ], info_messages()) meeting = Meeting.get(self.meeting.meeting_id) # refresh meeting self.assertIsNotNone(meeting.protocol_document) generated_document = meeting.protocol_document self.assertIsNotNone(generated_document) self.assertEqual(0, generated_document.generated_version) self.assertEqual(meeting, generated_document.meeting)
def test_protocol_can_be_generated(self, browser): self.setup_protocol(browser) browser.css('a[href*="@@generate_protocol"]').first.click() self.assertEquals( ['Protocol for meeting My meeting ' 'has been generated successfully'], info_messages()) meeting = Meeting.get(self.meeting.meeting_id) # refresh meeting self.assertIsNotNone(meeting.protocol_document) generated_document = meeting.protocol_document self.assertIsNotNone(generated_document) self.assertEqual(0, generated_document.generated_version) self.assertEqual(meeting, generated_document.meeting)
def test_manual_excerpt_can_be_generated(self, browser): browser.login().open(self.meeting.get_url()) browser.css('.generate-excerpt').first.click() browser.fill({'agenda_item-1.include:record': True, 'Target dossier': self.dossier}) browser.find('Save').click() self.assertEqual([u'Excerpt for meeting C\xf6mmunity meeting has ' 'been generated successfully'], info_messages()) # refresh meeting = Meeting.get(self.meeting.meeting_id) self.assertEqual(1, len(meeting.excerpt_documents)) document = meeting.excerpt_documents[0] self.assertEqual(0, document.generated_version) self.assertEqual(self.meeting.get_url(), browser.url, 'should be on meeting view') self.assertEqual(1, len(browser.css('.excerpts li a.document_link')), 'generated document should be linked') self.assertEqual([u'Protocol Excerpt-C\xf6mmunity meeting'], browser.css('.excerpts li a.document_link').text)