def test_menu_cache_key_on_communes(self): communes = getattr(self.portal, 'commune') viewlet = CpskinMenuViewlet(communes, self.request, None, None) viewlet.update() key = cache_key(viewlet.superfish_portal_tabs, viewlet) self.assertTrue(key.startswith('menu.')) self.assertTrue(key.endswith(IUUID(communes)))
def test_menu_cache_key_on_communes_subitem(self): item = self.portal.restrictedTraverse('commune/services_communaux') communes = getattr(self.portal, 'commune') viewlet = CpskinMenuViewlet(item, self.request, None, None) viewlet.update() key = cache_key(viewlet.superfish_portal_tabs, viewlet) self.assertTrue(key.startswith('menu.')) self.assertTrue(key.endswith(IUUID(communes)))
def test_menu_cache_key_on_root(self): viewlet = CpskinMenuViewlet(self.portal, self.request, None, None) viewlet.update() key = cache_key(viewlet.superfish_portal_tabs, viewlet) self.assertTrue(key.startswith('menu.')) self.assertTrue(key.endswith(IUUID(self.portal)))