def test_getPreviousItem_startFromFirstFile(self): currentfile = self.portal.file0 navviewlet = NavigationViewlet( currentfile, {'compilationuid': IUUID(self.compilation)}, {}, None) navviewlet.update() currentItem = navviewlet.getCurrentItem() self.assertEqual(navviewlet.getPreviousItem(currentItem), None)
def test_getPreviousItem_startFromSecondFile(self): currentfile = self.portal.file1 navviewlet = NavigationViewlet( currentfile, {'compilationuid': IUUID(self.compilation)}, {}, None) navviewlet.update() currentItem = navviewlet.getCurrentItem() prevItem = self.compilation.section001.contentref0 self.assertEqual(navviewlet.getPreviousItem(currentItem), prevItem)