Exemplo n.º 1
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."
Exemplo n.º 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."
    def test_unregister_utility(self):
        unregisterUtility(self.portal)

        # And check if the utility is removed.
        self.assertEqual(queryUtility(ITinyMCE, default='Not found'), 'Not found')