Move move_comments test to the right position.
svn path=/plone.app.discussion/trunk/; revision=50947
This commit is contained in:
parent
80764e5597
commit
9cd4058bca
@ -233,30 +233,6 @@ class CommentCatalogTest(unittest.TestCase):
|
||||
path={'query':
|
||||
'/'.join(self.comment.getPhysicalPath())}))
|
||||
self.comment_brain = brains[0]
|
||||
|
||||
def test_move_comments_when_content_object_is_moved(self):
|
||||
brains = self.catalog.searchResults(portal_type = 'Discussion Item')
|
||||
self.assertEquals(len(brains), 1)
|
||||
self.assertEquals(brains[0].getPath(),
|
||||
'/plone/doc1/++conversation++default/' +
|
||||
str(self.comment_id))
|
||||
|
||||
# Create new folder
|
||||
self.portal.invokeFactory(id='folder1',
|
||||
title='Folder 1',
|
||||
type_name='Folder')
|
||||
transaction.savepoint(1)
|
||||
|
||||
# Move doc1 to folder1
|
||||
cp = self.portal.manage_cutObjects(ids=('doc1',))
|
||||
self.portal.folder1.manage_pasteObjects(cp)
|
||||
|
||||
brains = self.catalog.searchResults(portal_type = 'Discussion Item')
|
||||
|
||||
self.assertEquals(len(brains), 1)
|
||||
self.assertEquals(brains[0].getPath(),
|
||||
'/plone/folder1/doc1/++conversation++default/' +
|
||||
str(self.comment_id))
|
||||
|
||||
def test_title(self):
|
||||
self.assertEqual(self.comment_brain.Title, 'Jim on Document 1')
|
||||
@ -313,7 +289,31 @@ class CommentCatalogTest(unittest.TestCase):
|
||||
self.portal.manage_delObjects(["doc1"])
|
||||
brains = self.catalog.searchResults({'portal_type': 'Discussion Item'})
|
||||
self.assertEqual(len(brains), 0)
|
||||
|
||||
|
||||
def test_move_comments_when_content_object_is_moved(self):
|
||||
brains = self.catalog.searchResults(portal_type = 'Discussion Item')
|
||||
self.assertEquals(len(brains), 1)
|
||||
self.assertEquals(brains[0].getPath(),
|
||||
'/plone/doc1/++conversation++default/' +
|
||||
str(self.comment_id))
|
||||
|
||||
# Create new folder
|
||||
self.portal.invokeFactory(id='folder1',
|
||||
title='Folder 1',
|
||||
type_name='Folder')
|
||||
transaction.savepoint(1)
|
||||
|
||||
# Move doc1 to folder1
|
||||
cp = self.portal.manage_cutObjects(ids=('doc1',))
|
||||
self.portal.folder1.manage_pasteObjects(cp)
|
||||
|
||||
brains = self.catalog.searchResults(portal_type = 'Discussion Item')
|
||||
|
||||
self.assertEquals(len(brains), 1)
|
||||
self.assertEquals(brains[0].getPath(),
|
||||
'/plone/folder1/doc1/++conversation++default/' +
|
||||
str(self.comment_id))
|
||||
|
||||
def test_clear_and_rebuild_catalog(self):
|
||||
# Clear and rebuild catalog
|
||||
self.catalog.clearFindAndRebuild()
|
||||
|
Loading…
Reference in New Issue
Block a user