Beispiel #1
0
 def testSortableNonASCIITitles(self):
     #test a utf-8 encoded string gets properly unicode converted
     title = 'La Pe\xc3\xb1a'
     doc = self.folder.doc
     doc.setTitle(title)
     wrapped = ExtensibleIndexableObjectWrapper(doc, self.portal)
     wrapped.update(vars={})
     self.assertEqual(wrapped.sortable_title, u'la pe\xf1a'.encode('utf-8'))
Beispiel #2
0
 def testWrapper(self):
     doc = self.doc
     vars = {'var' : 'a var'}
     wrapped = ExtensibleIndexableObjectWrapper(doc, self.portal)
     wrapped.update(vars)
     self.failUnlessEqual(wrapped.var, 'a var')
     self.failUnlessEqual(wrapped.getId(), 'doc')
     self.failUnlessEqual(wrapped.Title(), 'document')
     self.failUnlessEqual(wrapped.dummy, 'a dummy')
Beispiel #3
0
    def test_provided(self):
        from Products.CMFCore.interfaces import IContentish
        from Products.CMFCore.interfaces import IIndexableObjectWrapper
        from Products.CMFCore.tests.base.dummy import DummyContent

        obj = DummyContent()
        w = ExtensibleIndexableObjectWrapper(obj, self.portal)
        w.update(vars={})
        self.failUnless(IContentish.providedBy(w))
        self.failUnless(IIndexableObjectWrapper.providedBy(w))
Beispiel #4
0
    def testSortableTitleOutput(self):
        doc = self.folder.doc
        wrapped = ExtensibleIndexableObjectWrapper(doc, self.portal)
        wrapped.update(vars={})

        self.assertEqual(wrapped.sortable_title, u'00000012 document 00000025')