diff options
author | Jacob Mason <jacoblmason@gmail.com> | 2010-08-05 15:01:13 -0500 |
---|---|---|
committer | Jacob Mason <jacoblmason@gmail.com> | 2010-08-05 15:01:13 -0500 |
commit | fbd047b8f593a439d0a8ca9eec02ad2491d2bd78 (patch) | |
tree | 661ccfd0cd87918f75b4b3c59032a5611c0a7a30 /tests/test_websupport.py | |
parent | d0e272e61f34364f5cf9345363d5680f041fdf8f (diff) | |
download | sphinx-git-fbd047b8f593a439d0a8ca9eec02ad2491d2bd78.tar.gz |
Ensure hidden comments can't be replied to
Diffstat (limited to 'tests/test_websupport.py')
-rw-r--r-- | tests/test_websupport.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/test_websupport.py b/tests/test_websupport.py index e9c68cf63..2db29a2e1 100644 --- a/tests/test_websupport.py +++ b/tests/test_websupport.py @@ -81,8 +81,14 @@ def test_comments(support): comment = support.add_comment('First test comment', node_id=str(first_node.id), username='user_one') - support.add_comment('Hidden comment', node_id=str(first_node.id), - displayed=False) + hidden_comment = support.add_comment('Hidden comment', + node_id=str(first_node.id), + displayed=False) + # Make sure that comments can't be added to a comment where + # displayed == False, since it could break the algorithm that + # converts a nodes comments to a tree. + raises(CommentNotAllowedError, support.add_comment, 'Not allowed', + parent_id=str(hidden_comment['id'])) # Add a displayed and not displayed child to the displayed comment. support.add_comment('Child test comment', parent_id=str(comment['id']), username='user_one') @@ -144,6 +150,7 @@ def test_voting(support): comment = data['comments'][0] assert comment['vote'] == 1, '%s != 1' % comment['vote'] + @with_support() def test_proposals(support): session = Session() |