def test_changed(self): from Products.LDAPMultiPlugins.exportimport import \ exportLDAPMultiPlugins site = self._initSite(use_changed=True) context = DummyExportContext(site) exportLDAPMultiPlugins(context) self.assertEqual(len(context._wrote), 1) filename, text, content_type = context._wrote[0] self.assertEqual(filename, 'tested.xml') self._compareDOM(text, _CHANGED_LMP_EXPORT) self.assertEqual(content_type, 'text/xml')
def test_changed(self): from Products.LDAPMultiPlugins.exportimport import \ exportLDAPMultiPlugins site = self._initSite(use_changed=True) context = DummyExportContext(site) exportLDAPMultiPlugins(context) self.assertEqual(len(context._wrote), 1) filename, text, content_type = context._wrote[0] self.assertEqual(filename, 'tested.xml') self._compareDOM(text, _CHANGED_LMP_EXPORT) self.assertEqual(content_type, 'text/xml')
def test_unchanged(self): from Products.LDAPMultiPlugins.exportimport import \ exportLDAPMultiPlugins site = self._initSite(use_changed=False) context = DummyExportContext(site) exportLDAPMultiPlugins(context) self.assertEqual(len(context._wrote), 1) filename, text, content_type = context._wrote[0] self.assertEqual(filename, 'tested.xml') self._compareDOM(text, _LDAPMULTIPLUGIN_BODY) self.assertEqual(content_type, 'text/xml')
def test_unchanged(self): from Products.LDAPMultiPlugins.exportimport import \ exportLDAPMultiPlugins site = self._initSite(use_changed=False) context = DummyExportContext(site) exportLDAPMultiPlugins(context) self.assertEqual(len(context._wrote), 1) filename, text, content_type = context._wrote[0] self.assertEqual(filename, 'tested.xml') self._compareDOM(text, _LDAPMULTIPLUGIN_BODY) self.assertEqual(content_type, 'text/xml')