Exemple #1
0
    def create_proposals_word(self):
        proposal1 = create(
            Builder('proposal')
            .within(self.dossier_baufrau)
            .having(committee=self.committee_law_model,
                    title=u'Genehmigung der Anstellung von Hannah Baufrau als '
                          u'Sachbearbeiterin einem Besch\xe4ftigungsgrad von 90%')
            .relate_to(self.document_baufrau_1,
                       self.document_baufrau_2,
                       self.document_baufrau_3)
            .with_proposal_file(assets.load('vertragsentwurf.docx'))
            .as_submitted())
        self.meeting_word.schedule_proposal(proposal1.load_model())

        self.meeting_word.schedule_ad_hoc(
            u'Genehmigung der Bestellung von Hannah Baufrau als Sachbearbeterin '
            u'einem Besch\xe4ftigungsgrad von 90%')

        proposal2 = create(
            Builder('proposal')
            .within(self.dossier_laws_1)
            .having(committee=self.committee_law_model,
                    title=u'Revision der Rechtslage f\xfcr eine Liberalisierung')
            .relate_to(self.document_laws_1, self.document_laws_2)
            .with_proposal_file(assets.load('vertragsentwurf.docx')))

        self.meeting_word.schedule_ad_hoc(
            u'Revision der Linkslage f\xfcr eine Liberalisierung')
Exemple #2
0
    def create_proposals_word(self):
        proposal1 = create(
            Builder('proposal').within(self.dossier_baufrau).having(
                committee=self.committee_law_model,
                title=u'Genehmigung der Anstellung von Hannah Baufrau als '
                u'Sachbearbeiterin einem Besch\xe4ftigungsgrad von 90%').
            relate_to(self.document_baufrau_1, self.document_baufrau_2,
                      self.document_baufrau_3).with_proposal_file(
                          assets.load('vertragsentwurf.docx')).as_submitted())
        self.meeting_word.schedule_proposal(proposal1.load_model())

        self.meeting_word.schedule_ad_hoc(
            u'Genehmigung der Bestellung von Hannah Baufrau als Sachbearbeterin '
            u'einem Besch\xe4ftigungsgrad von 90%')

        proposal2 = create(
            Builder('proposal').within(self.dossier_laws_1).having(
                committee=self.committee_law_model,
                title=u'Revision der Rechtslage f\xfcr eine Liberalisierung').
            relate_to(self.document_laws_1,
                      self.document_laws_2).with_proposal_file(
                          assets.load('vertragsentwurf.docx')))

        self.meeting_word.schedule_ad_hoc(
            u'Revision der Linkslage f\xfcr eine Liberalisierung')
 def mock_solr(self, response_file):
     conn = MagicMock(name='SolrConnection')
     schema_resp = assets.load('solr_schema.json')
     conn.get = MagicMock(name='get', return_value=SolrResponse(
         body=schema_resp, status=200))
     manager = MagicMock(name='SolrConnectionManager')
     manager.connection = conn
     manager.schema = SolrSchema(manager)
     solr = getUtility(ISolrSearch)
     solr._manager = manager
     search_resp = assets.load(response_file)
     solr.search = MagicMock(name='search', return_value=SolrResponse(
         body=search_resp, status=200))
     return solr
Exemple #4
0
    def test_updates_checksum_and_queue_storing_after_docproperty_update(
            self, browser):
        api.portal.set_registry_record('create_doc_properties',
                                       interface=ITemplateFolderProperties,
                                       value=True)

        dossier = create(Builder('dossier'))
        document = create(
            Builder('document').within(dossier).checked_out().with_asset_file(
                'with_gever_properties.docx'))

        # update
        document.file = NamedBlobFile(
            data=assets.load(u'with_gever_properties_update.docx'),
            filename=u'with_gever_properties.docx')
        checksum_before = IBumblebeeDocument(document).update_checksum()

        browser.login().open(document)
        browser.click_on('without comment')

        self.assertNotEqual(
            checksum_before,
            IBumblebeeDocument(document).get_checksum(),
            'Document checksum not updated after docproperties update.')
        self.assertNotEqual(
            checksum_before,
            obj2brain(document).bumblebee_checksum,
            'Document checksum not updated after docproperties update.')
Exemple #5
0
 def mock_solr(self, response_file):
     conn = MagicMock(name='SolrConnection')
     schema_resp = assets.load('solr_schema.json')
     conn.get = MagicMock(name='get',
                          return_value=SolrResponse(body=schema_resp,
                                                    status=200))
     manager = MagicMock(name='SolrConnectionManager')
     manager.connection = conn
     manager.schema = SolrSchema(manager)
     solr = getUtility(ISolrSearch)
     solr._manager = manager
     search_resp = assets.load(response_file)
     solr.search = MagicMock(name='search',
                             return_value=SolrResponse(body=search_resp,
                                                       status=200))
     return solr
    def test_uses_title_if_given(self, browser):
        self.login(self.regular_user, browser)
        msg = base64.b64encode(load('mail_with_one_mail_attachment.eml'))

        with self.observe_children(self.dossier) as children:
            browser.open(self.dossier.absolute_url(),
                         data=json.dumps({
                             "@type": "ftw.mail.mail",
                             "message": {
                                 "data": msg,
                                 "encoding": "base64",
                                 "filename": "testmail.eml"
                             },
                             "title": "Separate title"
                         }),
                         method='POST',
                         headers={
                             'Accept': 'application/json',
                             'Content-Type': 'application/json'
                         })

        self.assertEqual(browser.status_code, 201)
        self.assertEqual(1, len(children.get('added')))

        mail = children['added'].pop()
        self.assertEqual(mail.Title(), 'Separate title')
        self.assertEqual(mail.message.filename, 'Separate title.eml')
        self.assertEqual(mail.original_message, None)
 def with_asset_data(self, filename, content_type=None):
     self.with_data(assets.load(filename), unicode(filename),
                    content_type=content_type)
     if not content_type:
         extension = os.path.splitext(filename)[1]
         content_type = mimetypes.types_map.get(extension)
     return self
Exemple #8
0
    def test_updates_checksum_and_queue_storing_after_docproperty_update(self, browser):
        api.portal.set_registry_record('create_doc_properties',
                                       interface=ITemplateDossierProperties,
                                       value=True)

        dossier = create(Builder('dossier'))
        document = create(Builder('document')
                          .within(dossier)
                          .checked_out()
                          .with_asset_file('with_gever_properties.docx'))

        # update
        document.file = NamedBlobFile(
            data=assets.load(u'with_gever_properties_update.docx'),
            filename=u'with_gever_properties.docx')
        checksum_before = IBumblebeeDocument(document).update_checksum()

        browser.login().open(document)
        browser.click_on('without comment')

        self.assertNotEqual(
            checksum_before, IBumblebeeDocument(document).get_checksum(),
            'Document checksum not updated after docproperties update.')
        self.assertNotEqual(
            checksum_before, obj2brain(document).bumblebee_checksum,
            'Document checksum not updated after docproperties update.')
    def test_updates_checksum_after_docproperty_update(self):
        self.activate_feature('doc-properties')
        self.login(self.dossier_responsible)

        self.checkout_document(self.document)

        self.document.file = NamedBlobFile(
            data=assets.load(u'with_gever_properties_update.docx'),
            filename=u'with_gever_properties.docx',
        )

        checksum_before = IBumblebeeDocument(self.document).update_checksum()

        self.checkin_document(self.document)

        self.assertNotEqual(
            checksum_before,
            IBumblebeeDocument(self.document).get_checksum(),
            'Document checksum not updated after docproperties update.',
        )

        self.assertNotEqual(
            checksum_before,
            obj2brain(self.document).bumblebee_checksum,
            'Document checksum not updated after docproperties update.',
        )
Exemple #10
0
 def __init__(self, session):
     super(ProposalBuilder, self).__init__(session)
     self.arguments = {'title': 'Fooo',
                       'language': TranslatedTitle.FALLBACK_LANGUAGE}
     self.model_arguments = None
     self._transition = None
     self._proposal_file_data = assets.load('empty.docx')
     self._also_return_submitted_proposal = False
 def with_asset_data(self, filename, content_type=None):
     self.with_data(assets.load(filename),
                    unicode(filename),
                    content_type=content_type)
     if not content_type:
         extension = os.path.splitext(filename)[1]
         content_type = mimetypes.types_map.get(extension)
     return self
Exemple #12
0
 def __init__(self, session):
     super(ProposalBuilder, self).__init__(session)
     self.arguments = {
         'title': 'Fooo',
         'language': TranslatedTitle.FALLBACK_LANGUAGE
     }
     self.model_arguments = None
     self._transition = None
     self._proposal_file_data = assets.load('empty.docx')
     self._also_return_submitted_proposal = False
    def test_sablon_template_redirector(self, browser):
        self.login(self.administrator, browser)
        browser.open(self.templates, view='++add++opengever.meeting.sablontemplate')
        sablon_template = assets.load('valid_sablon_template.docx')
        browser.fill({
            'Title': u'Sablonv\xferlage',
            'File': (sablon_template, 'valid_sablon_template.docx', 'text/plain'),
        }).save()
        statusmessages.assert_no_error_messages()

        self.assertEquals('http://nohost/plone/vorlagen#sablontemplates-proxy',
                          browser.url)
    def test_quickupload_p7m_mail(self):
        dossier = create(Builder("dossier"))
        factory = IQuickUploadFileFactory(dossier)

        result = factory(filename='signed.p7m',
                         title=None,  # ignored by adapter
                         description=None,  # ignored by adapter
                         content_type='application/pkcs7-mime',
                         data=load('signed.p7m'),
                         portal_type='ftw.mail.mail')
        mail = result['success']
        self.assertEquals('Hello.p7m', mail.message.filename)
 def test_valid_template_is_accepted(self, browser):
     self.login(self.administrator, browser)
     browser.open(
         self.templates,
         view='++add++opengever.meeting.sablontemplate',
     )
     sablon_template = assets.load('valid_sablon_template.docx')
     browser.fill({
         'Title': u'Sablonv\xferlage',
         'File': (sablon_template, 'valid_sablon_template.docx', 'text/plain'),
     }).save()
     statusmessages.assert_no_error_messages()
    def mock_solr(self, response_file=None, response_json=None):
        conn = MagicMock(name='SolrConnection')
        schema_resp = assets.load('solr_schema.json')
        conn.get = MagicMock(name='get', return_value=SolrResponse(
            body=schema_resp, status=200))
        manager = MagicMock(name='SolrConnectionManager')
        manager.connection = conn
        manager.schema = SolrSchema(manager)
        solr = getUtility(ISolrSearch)
        solr._manager = manager
        if response_file:
            search_resp = assets.load(response_file)
        else:
            # Make sure status is in header
            if u'responseHeader' not in response_json:
                response_json[u'responseHeader'] = {}
            if 'status' not in response_json[u'responseHeader']:
                response_json[u'responseHeader']['status'] = 0
            search_resp = json.dumps(response_json)

        solr.search = MagicMock(name='search', return_value=SolrResponse(
            body=search_resp, status=200))
        return solr
 def test_valid_template_is_accepted(self, browser):
     self.login(self.administrator, browser)
     browser.open(
         self.templates,
         view='++add++opengever.meeting.sablontemplate',
     )
     sablon_template = assets.load('valid_sablon_template.docx')
     browser.fill({
         'Title':
         u'Sablonv\xferlage',
         'File':
         (sablon_template, 'valid_sablon_template.docx', 'text/plain'),
     }).save()
     statusmessages.assert_no_error_messages()
    def test_p7m_mail_creation(self):
        dossier = create(Builder("dossier"))
        to_address = IEmailAddress(self.request).get_email_for_object(dossier)

        msg = email.message_from_string(load('signed.p7m'))
        msg.replace_header('To', to_address)
        message = msg.as_string()

        obj = inbound.createMailInContainer(dossier, message)
        self.assertTrue(obj.preserved_as_paper)
        self.assertEqual(message, obj.message.data)
        self.assertEqual(MESSAGE_SOURCE_MAILIN, obj.message_source)
        self.assertEqual('Hello.p7m', obj.message.filename)
        self.assertEqual('application/pkcs7-mime', obj.message.contentType)
    def mock_solr(self, response_file=None, response_json=None):
        conn = MagicMock(name='SolrConnection')
        schema_resp = assets.load('solr_schema.json')
        conn.get = MagicMock(name='get', return_value=SolrResponse(
            body=schema_resp, status=200))
        manager = MagicMock(name='SolrConnectionManager')
        manager.connection = conn
        manager.schema = SolrSchema(manager)
        solr = getUtility(ISolrSearch)
        solr._manager = manager
        if response_file:
            search_resp = assets.load(response_file)
        else:
            # Make sure status is in header
            if u'responseHeader' not in response_json:
                response_json[u'responseHeader'] = {}
            if 'status' not in response_json[u'responseHeader']:
                response_json[u'responseHeader']['status'] = 0
            search_resp = json.dumps(response_json)

        solr.search = MagicMock(name='search', return_value=SolrResponse(
            body=search_resp, status=200))
        return solr
Exemple #20
0
 def test_create_mail_from_eml(self, browser):
     self.login(self.regular_user, browser)
     msg = base64.b64encode(load('mail_with_one_mail_attachment.eml'))
     browser.open(self.dossier.absolute_url(),
                  data='{"@type": "ftw.mail.mail",'
                  '"message": {"data": "%s", "encoding": "base64", '
                  '"filename": "testmail.eml"}}' % msg,
                  method='POST',
                  headers={
                      'Accept': 'application/json',
                      'Content-Type': 'application/json'
                  })
     self.assertEqual(browser.status_code, 201)
     mail = self.dossier.objectValues()[-1]
     self.assertEqual(mail.Title(), 'Äusseres Testmäil')
     self.assertEqual(mail.message.filename, 'ausseres-testmail.eml')
     self.assertEqual(mail.original_message, None)
    def test_valid_template_is_accepted(self, browser):
        self.login(self.administrator, browser)
        browser.open(
            self.templates,
            view='++add++opengever.meeting.sablontemplate',
        )
        sablon_template = assets.load('valid_sablon_template.docx')
        browser.fill({
            'Title': u'Sablonv\xferlage',
            'File': (sablon_template, 'valid_sablon_template.docx', 'text/plain'),
        }).save()
        statusmessages.assert_no_error_messages()

        # Go to the created template's detail view
        browser.open(browser.context.listFolderContents()[-1])

        self.assertEquals([], statusmessages.error_messages())
Exemple #22
0
 def test_create_mail_from_msg_converts_to_eml(self, browser):
     self.login(self.regular_user, browser)
     msg = base64.b64encode(load('testmail.msg'))
     browser.open(self.dossier.absolute_url(),
                  data='{"@type": "ftw.mail.mail",'
                  '"message": {"data": "%s", "encoding": "base64", '
                  '"filename": "testmail.msg"}}' % msg,
                  method='POST',
                  headers={
                      'Accept': 'application/json',
                      'Content-Type': 'application/json'
                  })
     self.assertEqual(browser.status_code, 201)
     mail = self.dossier.objectValues()[-1]
     self.assertEqual(mail.Title(), 'testmail')
     self.assertEqual(mail.message.filename, 'testmail.eml')
     self.assertIn('MIME-Version: 1.0', mail.message.data)
     self.assertEqual(mail.original_message.filename, 'testmail.msg')
    def test_invalid_template_is_not_rejected_but_status_is_shown(self, browser):
        self.login(self.administrator, browser)
        browser.open(
            self.templates,
            view='++add++opengever.meeting.sablontemplate',
        )
        sablon_template = assets.load('invalid_sablon_template.docx')
        browser.fill({
            'Title': u'Sablonv\xferlage',
            'File': (sablon_template, 'invalid_sablon_template.docx', 'text/plain'),
        }).save()
        statusmessages.assert_no_error_messages()

        # Go to the created template's detail view
        browser.open(browser.context.listFolderContents()[-1])

        self.assertEquals(['This template will not render correctly.'],
                          statusmessages.error_messages())
Exemple #24
0
    def test_valid_template_is_accepted(self, browser):
        self.login(self.administrator, browser)
        browser.open(
            self.templates,
            view='++add++opengever.meeting.sablontemplate',
        )
        sablon_template = assets.load('valid_sablon_template.docx')
        browser.fill({
            'Title':
            u'Sablonv\xferlage',
            'File':
            (sablon_template, 'valid_sablon_template.docx', 'text/plain'),
        }).save()
        statusmessages.assert_no_error_messages()

        # Go to the created template's detail view
        browser.open(browser.context.listFolderContents()[-1])

        self.assertEquals([], statusmessages.error_messages())
    def test_invalid_template_is_not_rejected_but_status_is_shown(
            self, browser):
        self.login(self.administrator, browser)
        browser.open(
            self.templates,
            view='++add++opengever.meeting.sablontemplate',
        )
        sablon_template = assets.load('invalid_sablon_template.docx')
        browser.fill({
            'Title':
            u'Sablonv\xferlage',
            'File':
            (sablon_template, 'invalid_sablon_template.docx', 'text/plain'),
        }).save()
        statusmessages.assert_no_error_messages()

        # Go to the created template's detail view
        browser.open(browser.context.listFolderContents()[-1])

        self.assertEquals(['This template will not render correctly.'],
                          statusmessages.error_messages())
Exemple #26
0
    def test_create_mail_from_eml(self, browser):
        self.login(self.regular_user, browser)
        msg = base64.b64encode(load('mail_with_one_mail_attachment.eml'))

        with self.observe_children(self.dossier) as children:
            browser.open(
                self.dossier.absolute_url(),
                data='{"@type": "ftw.mail.mail",'
                     '"message": {"data": "%s", "encoding": "base64", '
                     '"filename": "testmail.eml"}}' % msg,
                method='POST',
                headers={'Accept': 'application/json',
                         'Content-Type': 'application/json'})

        self.assertEqual(browser.status_code, 201)
        self.assertEqual(1, len(children.get('added')))

        mail = children['added'].pop()
        self.assertEqual(mail.Title(), '\xc3\x84usseres Testm\xc3\xa4il')
        self.assertEqual(mail.message.filename, 'Aeusseres Testmaeil.eml')
        self.assertEqual(mail.original_message, None)
    def test_create_mail_from_p7m(self, browser):
        self.login(self.regular_user, browser)
        mail_file = base64.b64encode(load('signed.p7m'))

        with self.observe_children(self.dossier) as children:
            browser.open(self.dossier.absolute_url(),
                         data='{"@type": "ftw.mail.mail",'
                         '"message": {"data": "%s", "encoding": "base64", '
                         '"filename": "signed.p7m"}}' % mail_file,
                         method='POST',
                         headers={
                             'Accept': 'application/json',
                             'Content-Type': 'application/json'
                         })

        self.assertEqual(browser.status_code, 201)
        self.assertEqual(1, len(children.get('added')))

        mail = children['added'].pop()
        self.assertEqual(mail.Title(), 'Hello')
        self.assertEqual(mail.message.filename, 'Hello.p7m')
        self.assertEqual(mail.original_message, None)
    def test_create_mail_from_eml(self, browser):
        self.login(self.regular_user, browser)
        msg = base64.b64encode(load('mail_with_one_mail_attachment.eml'))

        with self.observe_children(self.dossier) as children:
            browser.open(self.dossier.absolute_url(),
                         data='{"@type": "ftw.mail.mail",'
                         '"message": {"data": "%s", "encoding": "base64", '
                         '"filename": "testmail.eml"}}' % msg,
                         method='POST',
                         headers={
                             'Accept': 'application/json',
                             'Content-Type': 'application/json'
                         })

        self.assertEqual(browser.status_code, 201)
        self.assertEqual(1, len(children.get('added')))

        mail = children['added'].pop()
        self.assertEqual(mail.Title(), '\xc3\x84usseres Testm\xc3\xa4il')
        self.assertEqual(mail.message.filename, 'Aeusseres Testmaeil.eml')
        self.assertEqual(mail.original_message, None)
Exemple #29
0
    def test_create_mail_from_msg_converts_to_eml(self, browser):
        self.login(self.regular_user, browser)
        msg = base64.b64encode(load('testmail.msg'))

        with self.observe_children(self.dossier) as children:
            browser.open(
                self.dossier.absolute_url(),
                data='{"@type": "ftw.mail.mail",'
                     '"message": {"data": "%s", "encoding": "base64", '
                     '"filename": "testmail.msg"}}' % msg,
                method='POST',
                headers={'Accept': 'application/json',
                         'Content-Type': 'application/json'})

        self.assertEqual(browser.status_code, 201)
        self.assertEqual(1, len(children.get('added')))

        mail = children['added'].pop()
        self.assertEqual(mail.Title(), 'testmail')
        self.assertEqual(mail.message.filename, 'testmail.eml')
        self.assertIn('MIME-Version: 1.0', mail.message.data)
        self.assertEqual(mail.original_message.filename, 'testmail.msg')
Exemple #30
0
    def test_uses_title_if_given(self, browser):
        self.login(self.regular_user, browser)
        msg = base64.b64encode(load('mail_with_one_mail_attachment.eml'))

        with self.observe_children(self.dossier) as children:
            browser.open(
                self.dossier.absolute_url(),
                data=json.dumps({"@type": "ftw.mail.mail",
                                 "message": {"data": msg,
                                             "encoding": "base64",
                                             "filename": "testmail.eml"},
                                 "title": "Separate title"}),
                method='POST',
                headers={'Accept': 'application/json',
                         'Content-Type': 'application/json'})

        self.assertEqual(browser.status_code, 201)
        self.assertEqual(1, len(children.get('added')))

        mail = children['added'].pop()
        self.assertEqual(mail.Title(), 'Separate title')
        self.assertEqual(mail.message.filename, 'Separate title.eml')
        self.assertEqual(mail.original_message, None)
Exemple #31
0
 def with_asset_file(self, filename):
     self.document.file = NamedBlobFile(
         assets.load(filename), filename=unicode(filename))
 def with_asset_message(self, filename):
     self.with_message(assets.load(filename), unicode(filename))
     return self
Exemple #33
0
 def with_asset_file(self, filename):
     self.attach_file_containing(assets.load(filename), unicode(filename))
     return self
Exemple #34
0
    def create_treaty_dossiers(self):
        self.dossier = self.register(
            'dossier',
            create(
                Builder('dossier').within(self.repofolder00).titled(
                    u'Vertr\xe4ge mit der kantonalen Finanzverwaltung').
                having(
                    description=u'Alle aktuellen Vertr\xe4ge mit der kantonalen '
                    u'Finanzverwaltung sind hier abzulegen. Vertr\xe4ge vor 2016 '
                    u'geh\xf6ren ins Archiv.',
                    keywords=(
                        u'Finanzverwaltung',
                        u'Vertr\xe4ge',
                    ),
                    start=date(2016, 1, 1),
                    responsible=self.dossier_responsible.getId(),
                    external_reference=u'qpr-900-9001-\xf7',
                )))

        create(
            Builder('contact_participation').for_contact(
                self.meier_ag).for_dossier(self.dossier).with_roles(
                    ['final-drawing']))

        create(
            Builder('contact_participation').for_contact(
                self.josef_buehler).for_dossier(self.dossier).with_roles(
                    ['final-drawing', 'participation']))

        self.document = self.register(
            'document',
            create(
                Builder('document').within(
                    self.dossier).titled(u'Vertr\xe4gsentwurf').having(
                        document_date=datetime(2010, 1, 3),
                        document_author=TEST_USER_ID,
                        document_type='contract',
                        receipt_date=datetime(2010, 1, 3),
                        delivery_date=datetime(2010, 1, 3),
                    ).attach_file_containing(
                        bumblebee_asset('example.docx').bytes(),
                        u'vertragsentwurf.docx')))

        self.task = self.register(
            'task',
            create(
                Builder('task').within(self.dossier).titled(
                    u'Vertragsentwurf \xdcberpr\xfcfen').having(
                        responsible_client=self.org_unit.id(),
                        responsible=self.regular_user.getId(),
                        issuer=self.dossier_responsible.getId(),
                        task_type='correction',
                        deadline=date(2016, 11, 1),
                    ).in_state('task-state-in-progress').relate_to(
                        self.document)))

        self.register(
            'subtask',
            create(
                Builder('task').within(self.task).titled(
                    u'Rechtliche Grundlagen in Vertragsentwurf \xdcberpr\xfcfen',
                ).having(
                    responsible_client=self.org_unit.id(),
                    responsible=self.regular_user.getId(),
                    issuer=self.dossier_responsible.getId(),
                    task_type='correction',
                    deadline=date(2016, 11, 1),
                ).in_state('task-state-resolved').relate_to(self.document)))

        self.register(
            'taskdocument',
            create(
                Builder('document').within(self.task).titled(
                    u'Feedback zum Vertragsentwurf').attach_file_containing(
                        'Feedback text',
                        u'vertr\xe4g sentwurf.docx',
                    )))

        proposal = self.register(
            'proposal',
            create(
                Builder('proposal').within(self.dossier).having(
                    title=
                    u'Vertragsentwurf f\xfcr weitere Bearbeitung bewilligen',
                    committee=self.committee.load_model(),
                ).relate_to(self.document).as_submitted()))

        self.register_path(
            'submitted_proposal',
            proposal.load_model().submitted_physical_path.encode('utf-8'),
        )

        self.register(
            'draft_proposal',
            create(
                Builder('proposal').within(self.dossier).having(
                    title=u'Antrag f\xfcr Kreiselbau',
                    committee=self.empty_committee.load_model(),
                )))

        self.decided_proposal = create(
            Builder('proposal').within(self.dossier).having(
                title=u'Initialvertrag f\xfcr Bearbeitung',
                committee=self.committee.load_model(),
            ).as_submitted())

        self.register_path(
            'decided_proposal',
            self.decided_proposal.load_model().submitted_physical_path.encode(
                'utf-8'),
        )

        with self.features('meeting', 'word-meeting'):
            word_proposal = self.register(
                'word_proposal',
                create(
                    Builder('proposal').within(self.dossier).having(
                        title=u'\xc4nderungen am Personalreglement',
                        committee=self.committee.load_model(),
                    ).relate_to(self.document).with_proposal_file(
                        assets.load('vertragsentwurf.docx')).as_submitted()))

            self.register_path(
                'submitted_word_proposal',
                word_proposal.load_model().submitted_physical_path.encode(
                    'utf-8'),
            )

            self.register(
                'draft_word_proposal',
                create(
                    Builder('proposal').within(self.dossier).having(
                        title=u'\xdcberarbeitung der GAV',
                        committee=self.empty_committee.load_model(),
                    )))

        subdossier = self.register(
            'subdossier',
            create(
                Builder('dossier').within(self.dossier).titled(u'2016').having(
                    keywords=(u'Subkeyword', u'Subkeyw\xf6rd'), )))

        self.register(
            'subdossier2',
            create(Builder('dossier').within(self.dossier).titled(u'2015')))

        self.register(
            'subdocument',
            create(
                Builder('document').within(subdossier).titled(
                    u'\xdcbersicht der Vertr\xe4ge von 2016').
                attach_file_containing(
                    'Excel dummy content',
                    u'tab\xe4lle.xlsx',
                )))

        archive_dossier = self.register(
            'archive_dossier',
            create(
                Builder('dossier').within(
                    self.repofolder00).titled(u'Archiv Vertr\xe4ge').having(
                        description=u'Archiv der Vertr\xe4ge vor 2016.',
                        keywords=(u'Vertr\xe4ge'),
                        start=date(2000, 1, 1),
                        end=date(2015, 12, 31),
                        responsible=self.dossier_responsible.getId(),
                    ).in_state('dossier-state-resolved')))

        archive_document = self.register(
            'archive_document',
            create(
                Builder('document').within(archive_dossier).titled(
                    u'\xdcbersicht der Vertr\xe4ge vor 2016').
                attach_archival_file_containing(
                    'TEST', name=u'test.pdf').with_dummy_content()))

        self.register(
            'archive_task',
            create(
                Builder('task').within(archive_dossier).
                titled(u'Vertr\xe4ge abschliessen').having(
                    responsible_client=self.org_unit.id(),
                    responsible=self.regular_user.getId(),
                    issuer=self.dossier_responsible.getId(),
                    task_type='correction',
                    deadline=date(2015, 12, 31),
                ).in_state('task-state-resolved').relate_to(archive_document)))

        inactive_dossier = self.register(
            'inactive_dossier',
            create(
                Builder('dossier').within(
                    self.repofolder00).titled(u'Inaktive Vertr\xe4ge').having(
                        description=u'Inaktive Vertr\xe4ge von 2016.',
                        keywords=(u'Vertr\xe4ge'),
                        start=date(2016, 1, 1),
                        end=date(2016, 12, 31),
                        responsible=self.dossier_responsible.getId(),
                    ).in_state('dossier-state-inactive')))

        inactive_document = self.register(
            'inactive_document',
            create(
                Builder('document').within(inactive_dossier).titled(
                    u'\xdcbersicht der Inaktiven Vertr\xe4ge von 2016').
                attach_file_containing('Excel dummy content',
                                       u'tab\xe4lle.xlsx')))

        self.register(
            'inactive_task',
            create(
                Builder('task').within(inactive_dossier).titled(
                    u'Status \xdcberpr\xfcfen').having(
                        responsible_client=self.org_unit.id(),
                        responsible=self.regular_user.getId(),
                        issuer=self.dossier_responsible.getId(),
                        task_type='correction',
                        deadline=date(2016, 11, 1),
                    ).in_state('task-state-in-progress').relate_to(
                        inactive_document)))
Exemple #35
0
 def with_asset_file(self, filename):
     self.attach_file_containing(assets.load(filename), unicode(filename))
     return self
Exemple #36
0
 def with_asset_message(self, filename):
     self.with_message(assets.load(filename), unicode(filename))
     return self