summaryrefslogtreecommitdiff
path: root/tests/test_websupport.py
diff options
context:
space:
mode:
authorJacob Mason <jacoblmason@gmail.com>2010-08-16 10:11:52 -0500
committerJacob Mason <jacoblmason@gmail.com>2010-08-16 10:11:52 -0500
commitfd10895e5a3e5b2d5c80db0fb9d544607eb1ed5d (patch)
treee3ae6025a3a8116461ddd696dd6d7c1557135c1d /tests/test_websupport.py
parent68cb74ad777e472ff8a9140a3e7749619ce08ecb (diff)
downloadsphinx-git-fd10895e5a3e5b2d5c80db0fb9d544607eb1ed5d.tar.gz
fix moderation test
Diffstat (limited to 'tests/test_websupport.py')
-rw-r--r--tests/test_websupport.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/test_websupport.py b/tests/test_websupport.py
index 3e784405e..5ef7a902f 100644
--- a/tests/test_websupport.py
+++ b/tests/test_websupport.py
@@ -230,11 +230,13 @@ def moderation_callback(comment):
@with_support(moderation_callback=moderation_callback)
def test_moderation(support):
- raise SkipTest(
- 'test is broken, relies on order of test execution and numeric ids')
- accepted = support.add_comment('Accepted Comment', node_id=3,
+ session = Session()
+ nodes = session.query(Node).all()
+ node = nodes[7]
+ session.close()
+ accepted = support.add_comment('Accepted Comment', node_id=node.id,
displayed=False)
- rejected = support.add_comment('Rejected comment', node_id=3,
+ rejected = support.add_comment('Rejected comment', node_id=node.id,
displayed=False)
# Make sure the moderation_callback is called.
assert called == True
@@ -243,9 +245,9 @@ def test_moderation(support):
raises(UserNotAuthorizedError, support.reject_comment, accepted['id'])
support.accept_comment(accepted['id'], moderator=True)
support.reject_comment(rejected['id'], moderator=True)
- comments = support.get_data(3)['comments']
+ comments = support.get_data(node.id)['comments']
assert len(comments) == 1
- comments = support.get_data(3, moderator=True)['comments']
+ comments = support.get_data(node.id, moderator=True)['comments']
assert len(comments) == 1