def update(self): """ check if we are inside a Blog, if its true set it into self.blog """ self.context = aq_inner(self.context) self.blog = None # is context a Blog or inside a Blog? for ob in self.context.aq_chain: if ISiteRoot.providedBy(ob): break if IBlog.providedBy(ob): self.blog = ob break
def test_factory(self): fti = queryUtility(IDexterityFTI, name='Blog') factory = fti.factory new_object = createObject(factory) self.assertTrue(IBlog.providedBy(new_object))
def test_adding(self): self.assertTrue(IBlog.providedBy(self.blog))