def test_remove_editor(self):
        # First let's remove the editor
        remove_editor(self.portal)

        # Check if it is removed.

        portal_props = getUtility(IPropertiesTool)
        site_props = getattr(portal_props, 'site_properties', None)
        attrname = 'available_editors'
        editors = list(site_props.getProperty(attrname))
        self.assertNotIn('TinyMCE', editors)

        # And now add the editor.
        add_editor(self.portal)

        # And check if it is added.
        editors = list(site_props.getProperty(attrname))
        self.assertIn('TinyMCE', editors)
예제 #2
0
def uninstall(portal, reinstall=False):

    if not reinstall:

        # normal uninstall
        setup_tool = getToolByName(portal, 'portal_setup')
        setup_tool.runAllImportStepsFromProfile('profile-Products.TinyMCE:uninstall')

        # http://plone.org/products/tinymce/issues/44
        uninstall_mimetype_and_transforms(portal)

        # Remove TinyMCE as a possible editor
        remove_editor(portal)

        # remove utility
        unregisterUtility(portal)

        return "Ran all uninstall steps."
예제 #3
0
def uninstall(portal, reinstall=False):

    if not reinstall:

        # normal uninstall
        setup_tool = getToolByName(portal, 'portal_setup')
        setup_tool.runAllImportStepsFromProfile(
            'profile-Products.TinyMCE:uninstall')

        # http://plone.org/products/tinymce/issues/44
        uninstall_mimetype_and_transforms(portal)

        # Remove TinyMCE as a possible editor
        remove_editor(portal)

        # remove utility
        unregisterUtility(portal)

        return "Ran all uninstall steps."