def test_zip_export_link_on_meeting_view(self, browser):
        meeting = create(
            Builder('meeting')
            .having(committee=self.committee.load_model(),
                    start=self.localized_datetime(2013, 1, 1, 8, 30),
                    end=self.localized_datetime(2013, 1, 1, 10, 30),
                    location='There',
                    presidency=self.hugo,
                    participants=[self.peter,
                                  self.hans,
                                  self.roland],
                    secretary=self.sile)
            .link_with(self.meeting_dossier))

        browser.login().open(meeting.get_url())
        self.assertTrue(browser.css('a.download-zipexport-btn'))
        self.assertEquals(
            'Export as Zip',
            browser.css('.item.zip-download > .title').first.text)

        browser.css('a.download-zipexport-btn').first.click()
        zip_file = ZipFile(StringIO(browser.contents), 'r')

        self.assertIsNone(zip_file.testzip(),
                          'Got a invalid zip file.')
        self.assertEquals(
            'Community meeting.zip',
            cgi.parse_header(browser.headers['content-disposition'])[1]['filename'],
            'Wrong zip filename.')
예제 #2
0
    def test_smoke_debug_docxcompose(self, browser):
        self.login(self.manager, browser)

        self.schedule_proposal(self.meeting, self.submitted_word_proposal)
        self.schedule_ad_hoc(self.meeting, "Foo")
        self.schedule_paragraph(self.meeting, "Bar")

        browser.open(self.meeting, view='debug_docxcompose')
        zip_file = ZipFile(StringIO(browser.contents), 'r')

        self.assertIsNone(zip_file.testzip(), 'Got a invalid zip file.')
    def test_smoke_debug_excerpt_docxcompose(self, browser):
        self.login(self.manager, browser)

        agenda_1 = self.schedule_proposal(
            self.meeting, self.submitted_word_proposal)
        agenda_2 = self.schedule_ad_hoc(self.meeting, "Foo")
        agenda_paragraph = self.schedule_paragraph(self.meeting, "Bar")

        browser.open(self.agenda_item_url(agenda_1, 'debug_excerpt_docxcompose'))
        zip_file = ZipFile(StringIO(browser.contents), 'r')
        self.assertIsNone(zip_file.testzip(),
                          'Got a invalid zip file.')

        browser.open(self.agenda_item_url(agenda_2, 'debug_excerpt_docxcompose'))
        zip_file = ZipFile(StringIO(browser.contents), 'r')
        self.assertIsNone(zip_file.testzip(),
                          'Got a invalid zip file.')

        with browser.expect_http_error(404):
            browser.open(self.agenda_item_url(
                agenda_paragraph, 'debug_excerpt_docxcompose'))
    def test_smoke_debug_docxcompose(self, browser):
        self.login(self.manager, browser)

        self.schedule_proposal(self.meeting, self.submitted_word_proposal)
        self.schedule_ad_hoc(self.meeting, "Foo")
        self.schedule_paragraph(self.meeting, "Bar")

        browser.open(self.meeting, view='debug_docxcompose')
        zip_file = ZipFile(StringIO(browser.contents), 'r')

        self.assertIsNone(zip_file.testzip(),
                          'Got a invalid zip file.')
    def test_zip_export_link_on_meeting_view(self, browser):
        self.login(self.committee_responsible, browser)
        browser.open(self.meeting)
        editbar.menu_option('Actions', 'Export as Zip').click()

        zip_file = ZipFile(StringIO(browser.contents), 'r')

        self.assertIsNone(zip_file.testzip(),
                          'Got a invalid zip file.')
        self.assertEquals(
            '9. Sitzung der Rechnungsprufungskommission.zip',
            cgi.parse_header(browser.headers['content-disposition'])[1]['filename'],
            'Wrong zip filename.')
예제 #6
0
    def test_smoke_debug_excerpt_docxcompose(self, browser):
        self.login(self.manager, browser)

        agenda_1 = self.schedule_proposal(self.meeting,
                                          self.submitted_proposal)
        agenda_2 = self.schedule_ad_hoc(self.meeting, "Foo")
        agenda_paragraph = self.schedule_paragraph(self.meeting, "Bar")

        browser.open(
            self.agenda_item_url(agenda_1, 'debug_excerpt_docxcompose'))
        zip_file = ZipFile(StringIO(browser.contents), 'r')
        self.assertIsNone(zip_file.testzip(), 'Got a invalid zip file.')

        browser.open(
            self.agenda_item_url(agenda_2, 'debug_excerpt_docxcompose'))
        zip_file = ZipFile(StringIO(browser.contents), 'r')
        self.assertIsNone(zip_file.testzip(), 'Got a invalid zip file.')

        with browser.expect_http_error(404):
            browser.open(
                self.agenda_item_url(agenda_paragraph,
                                     'debug_excerpt_docxcompose'))
예제 #7
0
    def test_zip_export_link_on_meeting_view(self, browser):
        self.login(self.committee_responsible, browser)
        browser.open(self.meeting)
        self.assertTrue(browser.css('a.download-zipexport-btn'))
        self.assertEquals(
            'Export as Zip',
            browser.css('.item.zip-download > .title').first.text)

        browser.css('a.download-zipexport-btn').first.click()
        zip_file = ZipFile(StringIO(browser.contents), 'r')

        self.assertIsNone(zip_file.testzip(),
                          'Got a invalid zip file.')
        self.assertEquals(
            '9. Sitzung der Rechnungsprufungskommission.zip',
            cgi.parse_header(browser.headers['content-disposition'])[1]['filename'],
            'Wrong zip filename.')