Пример #1
0
class TestITextContentAdapter(PloneboardTestCase.PloneboardTestCase):

    def afterSetUp(self):
        from Products.ATContentTypes.z3.interfaces import ITextContent 
        self.board = _createObjectByType('Ploneboard', self.folder, 'board')
        self.forum = _createObjectByType('PloneboardForum', self.board, 'forum')
        self.conv = self.forum.addConversation('conv1', 'conv1 body')
        
        self.comment = self.conv.objectValues()[0]
        self.textContent = ITextContent(self.comment)
        

    def testGetText(self):
        self.assertEqual(self.comment.getText(), 
                         self.textContent.getText())
    
    def testSetText(self):
        s = 'blah'
        self.textContent.setText('blah')
        
        self.assertEqual(self.comment.getText(), s)
        self.assertEqual(self.textContent.getText(), s)
        
    def testCookedBody(self):
        self.assertEqual(self.textContent.CookedBody(), 
                         self.comment.getText())

    def testEditableBody(self):
        self.assertEqual(self.textContent.CookedBody(), 
                         self.comment.getRawText())
Пример #2
0
 def afterSetUp(self):
     from Products.ATContentTypes.z3.interfaces import ITextContent 
     self.board = _createObjectByType('Ploneboard', self.folder, 'board')
     self.forum = _createObjectByType('PloneboardForum', self.board, 'forum')
     self.conv = self.forum.addConversation('conv1', 'conv1 body')
     
     self.comment = self.conv.objectValues()[0]
     self.textContent = ITextContent(self.comment)