def testWrapperAcquisitionParent(self): from collective.indexing.queue import wrap obj = self.folder wrapper = wrap(obj) self.assertEqual(aq_parent(wrapper), aq_parent(obj)) self.assertEqual(aq_parent(aq_inner(wrapper)), aq_parent(aq_inner(obj))) # also check an extended aq-chain obj = self.folder.__of__(self.portal.news) wrapper = wrap(obj) self.assertEqual(aq_parent(wrapper), aq_parent(obj))
def testWrapperAcquisitionParent(self): from collective.indexing.queue import wrap obj = self.folder wrapper = wrap(obj) self.assertEqual(aq_parent(wrapper), aq_parent(obj)) self.assertEqual( aq_parent(aq_inner(wrapper)), aq_parent(aq_inner(obj)), ) # also check an extended aq-chain obj = self.folder.__of__(self.portal.news) wrapper = wrap(obj) self.assertEqual(aq_parent(wrapper), aq_parent(obj))
def testWrapperAttributes(self): from collective.indexing.queue import wrap obj = self.folder wrapper = wrap(obj) self.assertEqual(wrapper.title, obj.title) self.assertEqual(wrapper.Title(), obj.Title()) self.assertEqual(wrapper.modified(), obj.modified()) # stripping away acquisition shouldn't make a difference... self.assertEqual(aq_base(wrapper).title, obj.title) self.assertEqual(aq_base(wrapper).Title(), obj.Title())
def testWrapperHash(self): from collective.indexing.queue import wrap obj = self.folder self.assertEqual(hash(wrap(obj)), hash(obj))
def testWrapperPath(self): from collective.indexing.queue import wrap obj = self.folder self.assertEqual(wrap(obj).getPhysicalPath(), obj.getPhysicalPath())
def testWrapperRequest(self): from collective.indexing.queue import wrap obj = self.folder self.assertEqual(wrap(obj).REQUEST, obj.REQUEST)