コード例 #1
0
ファイル: test_indexers.py プロジェクト: urska19/Plone-test
 def test_description(self):
     self.assertEqual(
         catalog.description(self.comment)(),
         'Lorem ipsum dolor sit amet.'
     )
     self.assertTrue(
         isinstance(catalog.description, DelegatingIndexerFactory))
コード例 #2
0
 def test_description(self):
     self.assertEqual(
         catalog.description(self.comment)(),
         'Lorem ipsum dolor sit amet.',
     )
     self.assertTrue(
         isinstance(catalog.description, DelegatingIndexerFactory))
    def test_description_long(self):
        # Create a 50 word comment and make sure the description returns
        # only the first 25 words
        comment_long = createObject('plone.Comment')
        comment_long.title = 'Long Comment'
        comment_long.text = LONG_TEXT

        self.conversation.addComment(comment_long)
        self.assertEqual(catalog.description(comment_long)(),
                          LONG_TEXT_CUT.replace("\n", " "))
コード例 #4
0
    def test_description_long(self):
        # Create a 50 word comment and make sure the description returns
        # only the first 25 words
        comment_long = createObject('plone.Comment')
        comment_long.title = 'Long Comment'
        comment_long.text = LONG_TEXT

        self.conversation.addComment(comment_long)
        self.assertEqual(
            catalog.description(comment_long)(),
            LONG_TEXT_CUT.replace("\n", " "))