Esempio n. 1
0
    def testUpgradeTinyMCE(self):
        # skip test in new Plones that don't install tinymce to begin with
        if 'portal_tinymce' not in self.portal:
            return

        alphas.upgradeTinyMCE(self.portal.portal_setup)
        jstool = getToolByName(self.portal, 'portal_javascripts')
        jsresourceids = jstool.getResourceIds()

        self.assertTrue('jquery.tinymce.js' in jsresourceids)
        for ne in ['tiny_mce.js', 'tiny_mce_init.js']:
            self.assertFalse(ne in jsresourceids)

        ksstool = getToolByName(self.portal, 'portal_kss', None)
        if ksstool is not None:
            kssresourceids = ksstool.getResourceIds()
            self.assertFalse(
                '++resource++tinymce.kss/tinymce.kss' in kssresourceids)

        request = self.app.REQUEST
        plone_view = queryMultiAdapter((self.portal, request), name="plone")
        manager = queryMultiAdapter(
            (self.portal, request, plone_view), IContentProvider, 'plone.htmlhead')
        viewlets = getAdapters(
            (manager.context, manager.request, manager.__parent__, manager), IViewlet)
        self.assertFalse(u'tinymce.configuration' in dict(viewlets))
Esempio n. 2
0
    def testUpgradeTinyMCE(self):
        alphas.upgradeTinyMCE(self.portal.portal_setup)
        jstool = getToolByName(self.portal, 'portal_javascripts')
        jsresourceids = jstool.getResourceIds()

        self.assertIn('jquery.tinymce.js', jsresourceids)
        for ne in ['tiny_mce.js', 'tiny_mce_init.js']:
            self.assertNotIn(ne, jsresourceids, ne)

        ksstool = getToolByName(self.portal, 'portal_kss', None)
        if ksstool is not None:
            kssresourceids = ksstool.getResourceIds()
            self.assertNotIn('++resource++tinymce.kss/tinymce.kss',
                             kssresourceids)

        request = self.app.REQUEST
        plone_view = queryMultiAdapter((self.portal, request), name="plone")
        manager = queryMultiAdapter(
                    (self.portal, request, plone_view), IContentProvider, 'plone.htmlhead')
        viewlets = getAdapters(
                (manager.context, manager.request, manager.__parent__, manager), IViewlet)
        self.assertIn(u'tinymce.configuration', dict(viewlets))
        storage = getUtility(IViewletSettingsStorage)
        skinname = self.portal.getCurrentSkinName()
        order_by_name = storage.getOrder('plone.htmlhead', skinname)
        self.assertEqual(order_by_name[-1], u'tinymce.configuration')
Esempio n. 3
0
    def testUpgradeTinyMCE(self):
        # skip test in new Plones that don't install tinymce to begin with
        if 'portal_tinymce' not in self.portal:
            return

        alphas.upgradeTinyMCE(self.portal.portal_setup)
        jstool = getToolByName(self.portal, 'portal_javascripts')
        jsresourceids = jstool.getResourceIds()

        self.assertTrue('jquery.tinymce.js' in jsresourceids)
        for ne in ['tiny_mce.js', 'tiny_mce_init.js']:
            self.assertFalse(ne in jsresourceids)

        ksstool = getToolByName(self.portal, 'portal_kss', None)
        if ksstool is not None:
            kssresourceids = ksstool.getResourceIds()
            self.assertFalse(
                '++resource++tinymce.kss/tinymce.kss' in kssresourceids)

        request = self.app.REQUEST
        plone_view = queryMultiAdapter((self.portal, request), name="plone")
        manager = queryMultiAdapter((self.portal, request, plone_view),
                                    IContentProvider, 'plone.htmlhead')
        viewlets = getAdapters(
            (manager.context, manager.request, manager.__parent__, manager),
            IViewlet)
        self.assertFalse(u'tinymce.configuration' in dict(viewlets))