Commit d11f3139 by Muzaffar yousaf

Merge pull request #661 from edx/muzaffar/remove-cancelled-sub-from-leaderboard-tnl1125

Added test for leaderboard Top X submissions.
parents 5c745b2c cc43fb66
......@@ -69,6 +69,34 @@ class TestLeaderboardRender(XBlockHandlerTransactionTestCase):
self._assert_leaderboard_visible(xblock, True)
@scenario('data/leaderboard_show.xml')
def test_show_submissions_that_have_greater_than_0_score(self, xblock):
# Create some submissions (but fewer than the max that can be shown)
self._create_submissions_and_scores(xblock, [
("test answer 0", 0),
("test answer 1", 1),
])
self._assert_scores(xblock, [
{"content": "test answer 1", "score": 1}
])
self._assert_leaderboard_visible(xblock, True)
# Since leaderboard results are cached, we need to clear
# the cache in order to see the new scores.
cache.clear()
# Create more submissions than the max
self._create_submissions_and_scores(xblock, [
("test answer 2", 10),
("test answer 3", 0)
])
self._assert_scores(xblock, [
{"content": "test answer 2", "score": 10},
{"content": "test answer 1", "score": 1}
])
self._assert_leaderboard_visible(xblock, True)
@scenario('data/leaderboard_show.xml')
def test_no_text_key_submission(self, xblock):
# Instead of using the default submission as a dict with "text",
# make the submission a string.
......
......@@ -5,7 +5,8 @@
# edX Internal Requirements
git+https://github.com/edx/XBlock.git@9c634481dfc85a17dcb3351ca232d7098a38e10e#egg=XBlock
edx-submissions>=0.0.8,<0.1.0
# edx-submissions
git+https://github.com/edx/edx-submissions.git@7d19adcc49045b225aa55441604928905b018b30#egg=edx-submissions
# Third Party Requirements
boto>=2.32.1,<3.0.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment