Ejemplo n.º 1
0
    def __call__(self):
        if not is_officeatwork_feature_enabled():
            raise Unauthorized

        ocmfile = OCMFile.for_officeatwork(self.context)
        if not ocmfile:
            raise Unauthorized

        return ocmfile.dump()
Ejemplo n.º 2
0
 def test_create_ocm_file_for_document(self):
     ocmfile = OCMFile.for_officeatwork(self.document)
     self.assertEqual(
         {'action': 'officeatwork',
          'cookie': '',
          'document': {
             'metadata': {},
             'title': u'Testdokum\xe4nt',
             'url': 'http://nohost/plone/dossier-1/document-1'}},
         ocmfile.get_data())
Ejemplo n.º 3
0
 def test_create_ocm_file_for_document(self):
     ocmfile = OCMFile.for_officeatwork(self.document)
     self.assertEqual(
         {
             "action": "officeatwork",
             "cookie": "",
             "document": {
                 "metadata": {},
                 "title": u"Testdokum\xe4nt",
                 "url": "http://nohost/plone/dossier-1/document-1",
             },
         },
         ocmfile.get_data(),
     )