CKEditor Uninstall
==================

    >>> app = layer['app']
    >>> portal = layer['portal']
    >>> from Products.CMFPlone.utils import get_installer
    >>> installer = get_installer(portal)
    >>> installer.is_product_installed('collective.ckeditor')
    True
    >>> installer.uninstall_product('collective.ckeditor')
    True


Control the wysiwyg_editor property in memberdata
-------------------------------------------------

    >>> memberdata = portal.portal_memberdata
    >>> memberdata.wysiwyg_editor
    ''

Control the available_editors in registry
-----------------------------------------

    >>> from zope.component import getUtility
    >>> from plone.registry.interfaces import IRegistry
    >>> registry = getUtility(IRegistry)

    >>> from Products.CMFPlone.interfaces import IEditingSchema
    >>> settings = registry.forInterface(IEditingSchema, prefix='plone', check=False)

    >>> 'CKeditor' in settings.available_editors
    False

Control the default_editor in registry
--------------------------------------

   >>> 'CKeditor' == settings.default_editor
    False

Control CKeditor settings in registry
-------------------------------------

    >>> from collective.ckeditor.browser.ckeditorsettings import ICKEditorSchema
    >>> registry.forInterface(ICKEditorSchema)
    Traceback (most recent call last):
    ...
    KeyError: 'Interface `collective.ckeditor.browser.ckeditorsettings.ICKEditorSchema` defines a field ...
    >>> registry.get("collective.ckeditor.toolbars", None) is None
    True

Control resource bundles in registry
------------------------------------

    >>> from Products.CMFPlone.interfaces import IBundleRegistry
    >>> bundles = registry.collectionOfInterface(IBundleRegistry, prefix="plone.bundles")
    >>> [name for name in bundles if name.startswith("collective.ckeditor")]
    []

Control portal_transforms uninstalls
------------------------------------

    >>> from Products.CMFCore.utils import getToolByName
    >>> transforms = getToolByName(portal, 'portal_transforms')
    >>> output_mimetype = 'text/x-html-safe'
    >>> cke_transform = 'ck_ruid_to_url'

Control if cke_transform is removed

    >>> cke_transform in transforms.objectIds()
    False

Control if ckeditor policies are removed
    >>> tpolicies = transforms.listPolicies()
    >>> mimetype_registered = False
    >>> for p in tpolicies :
    ...     out_type = p[0]
    ...     if out_type == output_mimetype :
    ...         policies = p[1]
    ...         if cke_transform in policies :
    ...             mimetype_registered = True
    ...             break
    >>> mimetype_registered
    False
