Esempio n. 1
0
 def test_logo_viewlet_portal_root_default(self):
     """When no logo is set, and viewlet is opened on a non-navigation root,
     obtain the default one from the portal.
     """
     viewlet = LogoViewlet(self.folder, self.app.REQUEST, None)
     viewlet.update()
     self.assertEqual(
         viewlet.img_src, '{0}/logo.png'.format(self.portal.absolute_url()))
Esempio n. 2
0
 def test_logo_viewlet_portal_root_default(self):
     """When no logo is set, and viewlet is opened on a non-navigation root,
     obtain the default one from the portal.
     """
     viewlet = LogoViewlet(self.folder, self.app.REQUEST, None)
     viewlet.update()
     self.assertEqual(viewlet.img_src,
                      '{0}/logo.png'.format(self.portal.absolute_url()))
Esempio n. 3
0
 def testLogoViewlet(self):
     """Logo links towards navigation root
     """
     self._invalidateRequestMemoizations()
     self.loginAsPortalOwner()
     self.app.REQUEST['ACTUAL_URL'] = self.folder.test.absolute_url()
     directlyProvides(self.folder, INavigationRoot)
     viewlet = LogoViewlet(self.folder.test, self.app.REQUEST, None)
     viewlet.update()
     self.assertEqual(viewlet.navigation_root_title, "Folder")
     self.assertTrue("http://nohost/plone/logo.png" in viewlet.logo_tag)
Esempio n. 4
0
    def testLogoViewletRegistry(self):
        """If logo is defined in plone.app.registry, use that one.
        """
        registry = getUtility(IRegistry)
        settings = registry.forInterface(ISiteSchema, prefix='plone')
        settings.site_logo = SITE_LOGO_BASE64

        viewlet = LogoViewlet(self.folder.test, self.app.REQUEST, None)
        viewlet.update()
        self.assertTrue(
            'http://nohost/plone/@@site-logo/pixel.png' in viewlet.img_src)
Esempio n. 5
0
 def testLogoViewlet(self):
     """Logo links towards navigation root
     """
     self._invalidateRequestMemoizations()
     self.loginAsPortalOwner()
     self.app.REQUEST['ACTUAL_URL'] = self.folder.test.absolute_url()
     directlyProvides(self.folder, INavigationRoot)
     viewlet = LogoViewlet(self.folder.test, self.app.REQUEST, None)
     viewlet.update()
     self.assertEquals(viewlet.navigation_root_title, "Folder")
     self.assertTrue("http://nohost/plone/logo.png" in viewlet.logo_tag)
Esempio n. 6
0
 def testLogoViewletDefault(self):
     """Logo links towards navigation root
     """
     self._invalidateRequestMemoizations()
     self.loginAsPortalOwner()
     self.app.REQUEST['ACTUAL_URL'] = self.folder.test.absolute_url()
     directlyProvides(self.folder, INavigationRoot)
     viewlet = LogoViewlet(self.folder.test, self.app.REQUEST, None)
     viewlet.update()
     self.assertEqual(viewlet.navigation_root_title, "Folder")
     # there is no theme yet in Plone 5, so we see the old png logo
     self.assertTrue("logo.png" in viewlet.img_src)
Esempio n. 7
0
    def testLogoViewletRegistry(self):
        """If logo is defined in plone.app.registry, use that one.
        """
        registry = getUtility(IRegistry)
        settings = registry.forInterface(ISiteSchema, prefix='plone')
        settings.site_logo = SITE_LOGO_BASE64

        viewlet = LogoViewlet(self.folder.test, self.app.REQUEST, None)
        viewlet.update()
        self.assertTrue(
            'http://nohost/plone/@@site-logo/pixel.png'
            in viewlet.img_src)
Esempio n. 8
0
 def testLogoViewletDefault(self):
     """Logo links towards navigation root
     """
     self._invalidateRequestMemoizations()
     self.loginAsPortalOwner()
     self.app.REQUEST['ACTUAL_URL'] = self.folder.test.absolute_url()
     directlyProvides(self.folder, INavigationRoot)
     viewlet = LogoViewlet(self.folder.test, self.app.REQUEST, None)
     viewlet.update()
     self.assertEqual(viewlet.navigation_root_title, "Folder")
     # there is no theme yet in Plone 5, so we see the old png logo
     self.assertTrue("logo.png" in viewlet.img_src)
Esempio n. 9
0
    def test_logo_viewlet_portal_root_registry(self):
        """When a logo is set, and viewlet is opened on a non-navigation root,
        obtain the registry logo from the portal.
        """
        registry = getUtility(IRegistry)
        settings = registry.forInterface(ISiteSchema, prefix='plone')
        settings.site_logo = SITE_LOGO_BASE64

        viewlet = LogoViewlet(self.folder, self.app.REQUEST, None)
        viewlet.update()
        self.assertTrue(
            viewlet.img_src,
            '{0}/@@site-logo/pixel.png'.format(self.portal.absolute_url()))
Esempio n. 10
0
    def test_logo_viewlet_portal_root_registry(self):
        """When a logo is set, and viewlet is opened on a non-navigation root,
        obtain the registry logo from the portal.
        """
        registry = getUtility(IRegistry)
        settings = registry.forInterface(ISiteSchema, prefix='plone')
        settings.site_logo = SITE_LOGO_BASE64

        viewlet = LogoViewlet(self.folder, self.app.REQUEST, None)
        viewlet.update()
        self.assertTrue(
            viewlet.img_src,
            '{0}/@@site-logo/pixel.png'.format(self.portal.absolute_url())
        )