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()))
Exemple #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()))
 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)
Exemple #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)
 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)
Exemple #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)
    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)
 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)
Exemple #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()))
Exemple #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())
        )