mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
fix moderation test
This commit is contained in:
parent
68cb74ad77
commit
fd10895e5a
@ -230,11 +230,13 @@ def moderation_callback(comment):
|
|||||||
|
|
||||||
@with_support(moderation_callback=moderation_callback)
|
@with_support(moderation_callback=moderation_callback)
|
||||||
def test_moderation(support):
|
def test_moderation(support):
|
||||||
raise SkipTest(
|
session = Session()
|
||||||
'test is broken, relies on order of test execution and numeric ids')
|
nodes = session.query(Node).all()
|
||||||
accepted = support.add_comment('Accepted Comment', node_id=3,
|
node = nodes[7]
|
||||||
|
session.close()
|
||||||
|
accepted = support.add_comment('Accepted Comment', node_id=node.id,
|
||||||
displayed=False)
|
displayed=False)
|
||||||
rejected = support.add_comment('Rejected comment', node_id=3,
|
rejected = support.add_comment('Rejected comment', node_id=node.id,
|
||||||
displayed=False)
|
displayed=False)
|
||||||
# Make sure the moderation_callback is called.
|
# Make sure the moderation_callback is called.
|
||||||
assert called == True
|
assert called == True
|
||||||
@ -243,9 +245,9 @@ def test_moderation(support):
|
|||||||
raises(UserNotAuthorizedError, support.reject_comment, accepted['id'])
|
raises(UserNotAuthorizedError, support.reject_comment, accepted['id'])
|
||||||
support.accept_comment(accepted['id'], moderator=True)
|
support.accept_comment(accepted['id'], moderator=True)
|
||||||
support.reject_comment(rejected['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
|
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
|
assert len(comments) == 1
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user