def compilationUID(obj): previousparent = parent = obj.aq_parent while ICompilation.providedBy(parent) or ISection.providedBy(parent): previousparent = parent parent = parent.aq_parent uuid = IUUID(previousparent) return uuid
def isSection(self, item): return ISection.providedBy(item)
def test_isSection(self): compilation = self.portal._getOb('compilation001') tochelper = TableOfContentsHelpers(compilation, {}) items = tochelper.getContentItems() for item in items: self.assertTrue(ISection.providedBy(item))