Example #1
0
 def should_get_two_threads_different_length(self):
     comment4 = Comment('Comment 4')
     comment3 = Comment('Comment 3', replies=[comment4])
     comment2 = Comment('Comment 2')
     comment1 = Comment('Comment 1', replies=[comment2, comment3])
     assert [[comment1, comment2], [comment1, comment3, comment4]] == list(get_threads(comment1))
Example #2
0
 def should_get_multiple_children(self):
     comment3 = Comment('Comment 3')
     comment2 = Comment('Comment 2')
     comment1 = Comment('Comment 1', replies=[comment2, comment3])
     assert [[comment1, comment2], [comment1, comment3]] == list(get_threads(comment1))
Example #3
0
 def should_get_three_thread(self):
     comment3 = Comment('Comment 3')
     comment2 = Comment('Comment 2', replies=[comment3])
     comment1 = Comment('Comment 1', replies=[comment2])
     assert [[comment1, comment2, comment3]] == list(get_threads(comment1))
Example #4
0
 def should_get_simple_thread(self):
     comment1 = Comment('Comment 1')
     assert [[comment1]] == list(get_threads(comment1))