コード例 #1
0
ファイル: test_exportimport.py プロジェクト: bendavis78/zope
    def test_nopurge(self):
        from Products.CMFActionIcons.exportimport \
            import importActionIconsTool

        site = self._initSite(with_icon=True)
        ait = site.portal_actionicons
        ait.updateActionIcon(self.CATEGORY,
                             self.ACTION_ID,
                             'somexpr',
                             title='foo',
                             priority=123)
        self.assertEqual(len(ait.listActionIcons()), 1)

        context = DummyImportContext(site, purge=False)
        context._files['actionicons.xml'] = self._WITH_ICON_EXPORT
        importActionIconsTool(context)

        self.assertEqual(len(ait.listActionIcons()), 1)
        action_icon = ait.listActionIcons()[0]

        self.assertEqual(action_icon.getCategory(), self.CATEGORY)
        self.assertEqual(action_icon.getActionId(), self.ACTION_ID)
        self.assertEqual(action_icon.getTitle(), self.TITLE)
        self.assertEqual(action_icon.getPriority(), self.PRIORITY)
        self.assertEqual(action_icon.getExpression(), self.ICON_EXPR)
コード例 #2
0
ファイル: test_exportimport.py プロジェクト: dtgit/dtedu
    def test_normal(self):
        from Products.CMFActionIcons.exportimport import importActionIconsTool

        site = self._initSite(with_icon=False)
        ait = site.portal_actionicons
        self.assertEqual(len(ait.listActionIcons()), 0)

        context = DummyImportContext(site)
        context._files["actionicons.xml"] = self._WITH_ICON_EXPORT
        importActionIconsTool(context)

        self.assertEqual(len(ait.listActionIcons()), 1)
        action_icon = ait.listActionIcons()[0]

        self.assertEqual(action_icon.getCategory(), self.CATEGORY)
        self.assertEqual(action_icon.getActionId(), self.ACTION_ID)
        self.assertEqual(action_icon.getTitle(), self.TITLE)
        self.assertEqual(action_icon.getPriority(), self.PRIORITY)
        self.assertEqual(action_icon.getExpression(), self.ICON_EXPR)
コード例 #3
0
ファイル: test_exportimport.py プロジェクト: goschtl/zope
    def test_nopurge(self):
        from Products.CMFActionIcons.exportimport \
            import importActionIconsTool

        site = self._initSite(with_icon=True)
        ait = site.portal_actionicons
        ait.updateActionIcon(self.CATEGORY, self.ACTION_ID, 'somexpr',
                             title='foo', priority=123)
        self.assertEqual(len(ait.listActionIcons()), 1)

        context = DummyImportContext(site, purge=False)
        context._files['actionicons.xml'] = self._WITH_ICON_EXPORT
        importActionIconsTool(context)

        self.assertEqual(len(ait.listActionIcons()), 1)
        action_icon = ait.listActionIcons()[0]

        self.assertEqual(action_icon.getCategory(), self.CATEGORY)
        self.assertEqual(action_icon.getActionId(), self.ACTION_ID)
        self.assertEqual(action_icon.getTitle(), self.TITLE)
        self.assertEqual(action_icon.getPriority(), self.PRIORITY)
        self.assertEqual(action_icon.getExpression(), self.ICON_EXPR)