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()
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())
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(), )