remove the test_dict_api from test_comments.py, since the test_dict_api from test_conversation.py tests both IReplies adapters.

svn path=/plone.app.discussion/trunk/; revision=27106
This commit is contained in:
Timo Stollenwerk 2009-05-25 10:38:58 +00:00
parent 0797579bfd
commit 731f83b706
2 changed files with 16 additions and 17 deletions

View File

@ -173,9 +173,5 @@ class RepliesTest(PloneTestCase):
# Make sure the first comment is still in the conversation # Make sure the first comment is still in the conversation
self.assertEquals(conversation.total_comments, 1) self.assertEquals(conversation.total_comments, 1)
def test_dict_api(self):
# ensure all operations use only top-level comments
pass
def test_suite(): def test_suite():
return unittest.defaultTestLoader.loadTestsFromName(__name__) return unittest.defaultTestLoader.loadTestsFromName(__name__)

View File

@ -129,26 +129,26 @@ class ConversationTest(PloneTestCase):
# Create the nested comment structure # Create the nested comment structure
new_id_1 = conversation.addComment(comment1) new_id_1 = conversation.addComment(comment1)
new_id_2 = conversation.addComment(comment2) new_id_2 = conversation.addComment(comment2)
comment1_1.in_reply_to = new_id_1 comment1_1.in_reply_to = new_id_1
new_id_1_1 = conversation.addComment(comment1_1) new_id_1_1 = conversation.addComment(comment1_1)
comment1_1_1.in_reply_to = new_id_1_1 comment1_1_1.in_reply_to = new_id_1_1
new_id_1_1_1 = conversation.addComment(comment1_1_1) new_id_1_1_1 = conversation.addComment(comment1_1_1)
comment1_2.in_reply_to = new_id_1 comment1_2.in_reply_to = new_id_1
new_id_1_2 = conversation.addComment(comment1_2) new_id_1_2 = conversation.addComment(comment1_2)
comment2_1.in_reply_to = new_id_2 comment2_1.in_reply_to = new_id_2
new_id_2_1 = conversation.addComment(comment2_1) new_id_2_1 = conversation.addComment(comment2_1)
del conversation[new_id_1] del conversation[new_id_1]
self.assertEquals( self.assertEquals(
[{'comment': comment2, 'depth': 0, 'id': new_id_2}, [{'comment': comment2, 'depth': 0, 'id': new_id_2},
{'comment': comment2_1, 'depth': 1, 'id': new_id_2_1}, {'comment': comment2_1, 'depth': 1, 'id': new_id_2_1},
], list(conversation.getThreads())) ], list(conversation.getThreads()))
def test_dict_operations(self): def test_dict_operations(self):
# test dict operations and acquisition wrapping # test dict operations and acquisition wrapping
@ -367,7 +367,7 @@ class ConversationTest(PloneTestCase):
pass pass
def test_get_threads(self): def test_get_threads(self):
# Create a conversation. In this case we doesn't assign it to an # Create a conversation. In this case we doesn't assign it to an
# object, as we just want to check the Conversation object API. # object, as we just want to check the Conversation object API.
conversation = IConversation(self.portal.doc1) conversation = IConversation(self.portal.doc1)
@ -415,19 +415,19 @@ class ConversationTest(PloneTestCase):
# Create the nested comment structure # Create the nested comment structure
new_id_1 = conversation.addComment(comment1) new_id_1 = conversation.addComment(comment1)
new_id_2 = conversation.addComment(comment2) new_id_2 = conversation.addComment(comment2)
comment1_1.in_reply_to = new_id_1 comment1_1.in_reply_to = new_id_1
new_id_1_1 = conversation.addComment(comment1_1) new_id_1_1 = conversation.addComment(comment1_1)
comment1_1_1.in_reply_to = new_id_1_1 comment1_1_1.in_reply_to = new_id_1_1
new_id_1_1_1 = conversation.addComment(comment1_1_1) new_id_1_1_1 = conversation.addComment(comment1_1_1)
comment1_2.in_reply_to = new_id_1 comment1_2.in_reply_to = new_id_1
new_id_1_2 = conversation.addComment(comment1_2) new_id_1_2 = conversation.addComment(comment1_2)
comment2_1.in_reply_to = new_id_2 comment2_1.in_reply_to = new_id_2
new_id_2_1 = conversation.addComment(comment2_1) new_id_2_1 = conversation.addComment(comment2_1)
# Get threads # Get threads
self.assertEquals( self.assertEquals(
@ -524,6 +524,9 @@ class RepliesTest(PloneTestCase):
self.assertEquals(len(replies), 0) self.assertEquals(len(replies), 0)
def test_dict_api(self): def test_dict_api(self):
# This test is for the ConversationReplies as well as the
# CommentReplies adapter.
#
# Ensure all operations use only top-level comments. Add some # Ensure all operations use only top-level comments. Add some
# deeper children and ensure that these are not exposed through the # deeper children and ensure that these are not exposed through the
# IReplies dict. # IReplies dict.