This commit is contained in:
tisto
2012-01-14 07:13:39 +01:00
parent f520482eb3
commit a3883d7e7b
7 changed files with 25 additions and 22 deletions
+5 -5
View File
@@ -71,7 +71,7 @@ class ConversationCatalogTest(unittest.TestCase):
brains = self.catalog.searchResults(dict(
path={'query':
'/'.join(self.portal.doc1.getPhysicalPath()) },
'/'.join(self.portal.doc1.getPhysicalPath())},
portal_type="Document"
))
self.conversation = conversation
@@ -95,7 +95,7 @@ class ConversationCatalogTest(unittest.TestCase):
comment2.reindexObject()
brains = self.catalog.searchResults(dict(
path={'query':
'/'.join(self.portal.doc1.getPhysicalPath()) },
'/'.join(self.portal.doc1.getPhysicalPath())},
portal_type="Document"
))
doc1_brain = brains[0]
@@ -120,7 +120,7 @@ class ConversationCatalogTest(unittest.TestCase):
comment2.reindexObject()
brains = self.catalog.searchResults(dict(
path={'query':
'/'.join(self.portal.doc1.getPhysicalPath()) },
'/'.join(self.portal.doc1.getPhysicalPath())},
portal_type="Document"
))
doc1_brain = brains[0]
@@ -132,7 +132,7 @@ class ConversationCatalogTest(unittest.TestCase):
brains = self.catalog.searchResults(dict(
path={'query':
'/'.join(self.portal.doc1.getPhysicalPath()) },
'/'.join(self.portal.doc1.getPhysicalPath())},
portal_type="Document"
))
doc1_brain = brains[0]
@@ -143,7 +143,7 @@ class ConversationCatalogTest(unittest.TestCase):
del self.conversation[self.new_comment1_id]
brains = self.catalog.searchResults(dict(
path={'query':
'/'.join(self.portal.doc1.getPhysicalPath()) },
'/'.join(self.portal.doc1.getPhysicalPath())},
portal_type="Document"
))
doc1_brain = brains[0]
+4 -3
View File
@@ -158,7 +158,8 @@ class CommentTest(unittest.TestCase):
comment1.text = "Go to http://www.plone.org"
comment1.mime_type = 'text/x-web-intelligent'
self.assertEqual(comment1.getText(),
'Go to <a href="http://www.plone.org" rel="nofollow">http://www.plone.org</a>')
'Go to <a href="http://www.plone.org" ' +
'rel="nofollow">http://www.plone.org</a>')
def test_getText_w_custom_targetMimetype(self):
comment1 = createObject('plone.Comment')
@@ -206,8 +207,7 @@ class CommentTest(unittest.TestCase):
self.assertEqual(1,
len(comment.workflow_history['comment_review_workflow']))
self.assertEqual(None,
comment.workflow_history['comment_review_workflow'][0]\
['action'])
comment.workflow_history['comment_review_workflow'][0]['action'])
self.assertEqual('pending',
self.portal.portal_workflow.getInfoFor(comment, 'review_state'))
@@ -393,5 +393,6 @@ class RepliesTest(unittest.TestCase):
str(new_re_re_re_id),
re_re_re_comment.absolute_url())
def test_suite():
return unittest.defaultTestLoader.loadTestsFromName(__name__)
+2 -3
View File
@@ -9,7 +9,6 @@ from DateTime import DateTime
from zope.component import createObject
from plone.app.testing import TEST_USER_ID, setRoles
from plone.app.testing import logout, login
from plone.app.discussion.testing import \
PLONE_APP_DISCUSSION_INTEGRATION_TESTING
@@ -108,7 +107,6 @@ class CommentIndexersTest(unittest.TestCase):
layer = PLONE_APP_DISCUSSION_INTEGRATION_TESTING
def setUp(self):
self.portal = self.layer['portal']
setRoles(self.portal, TEST_USER_ID, ['Manager'])
@@ -141,7 +139,8 @@ class CommentIndexersTest(unittest.TestCase):
def test_description(self):
self.assertEqual(catalog.description(self.comment)(),
'Lorem ipsum dolor sit amet.')
self.assertTrue(isinstance(catalog.description, DelegatingIndexerFactory))
self.assertTrue(
isinstance(catalog.description, DelegatingIndexerFactory))
def test_description_long(self):
# Create a 50 word comment and make sure the description returns