def test_with_policy(self): from Products.CMFCore.exportimport.contenttyperegistry import exportContentTypeRegistry site = self._initSite(mit_predikat=True) context = DummyExportContext(site) exportContentTypeRegistry(context) self.assertEqual(len(context._wrote), 1) filename, text, content_type = context._wrote[0] self.assertEqual(filename, "contenttyperegistry.xml") self._compareDOM(text, self._WITH_POLICY_EXPORT) self.assertEqual(content_type, "text/xml")
def test_empty(self): from Products.CMFCore.exportimport.contenttyperegistry \ import exportContentTypeRegistry site = self._initSite(mit_predikat=False) context = DummyExportContext(site) exportContentTypeRegistry(context) self.assertEqual(len(context._wrote), 1) filename, text, content_type = context._wrote[0] self.assertEqual(filename, 'contenttyperegistry.xml') self._compareDOM(text, self._EMPTY_EXPORT) self.assertEqual(content_type, 'text/xml')
def test_with_policy(self): from Products.CMFCore.exportimport.contenttyperegistry \ import exportContentTypeRegistry site = self._initSite(mit_predikat=True) context = DummyExportContext(site) exportContentTypeRegistry(context) self.assertEqual(len(context._wrote), 1) filename, text, content_type = context._wrote[0] self.assertEqual(filename, 'contenttyperegistry.xml') self._compareDOM(text, self._WITH_POLICY_EXPORT) self.assertEqual(content_type, 'text/xml')
def test_empty(self): from Products.CMFCore.exportimport.contenttyperegistry \ import exportContentTypeRegistry site, _ctr = self._initSite(mit_predikat=False) context = DummyExportContext(site) exportContentTypeRegistry(context) self.assertEqual(len(context._wrote), 1) filename, text, content_type = context._wrote[0] self.assertEqual(filename, 'contenttyperegistry.xml') self._compareDOM(text.decode('utf8'), self._EMPTY_EXPORT) self.assertEqual(content_type, 'text/xml')