Commit 3831f381 by Braden MacDonald Committed by GitHub

Merge pull request #159 from open-craft/bradmerlin/mrq-student_view_data-tests

Add simple test for MRQ student_view_data 
parents e338c740 327f7499
...@@ -7,12 +7,27 @@ from random import random ...@@ -7,12 +7,27 @@ from random import random
from xblock.field_data import DictFieldData from xblock.field_data import DictFieldData
from problem_builder.mcq import MCQBlock from problem_builder.mcq import MCQBlock
from problem_builder.mrq import MRQBlock
from problem_builder.mentoring import MentoringBlock, MentoringMessageBlock, _default_options_config from problem_builder.mentoring import MentoringBlock, MentoringMessageBlock, _default_options_config
from .utils import BlockWithChildrenTestMixin from .utils import BlockWithChildrenTestMixin
@ddt.ddt @ddt.ddt
class TestMRQBlock(BlockWithChildrenTestMixin, unittest.TestCase):
def test_student_view_data(self):
"""
Ensure that all expected fields are always returned.
"""
block = MRQBlock(Mock(), DictFieldData({}), Mock())
self.assertListEqual(
block.student_view_data().keys(),
['hide_results', 'tips', 'weight', 'title', 'question', 'message', 'type', 'id', 'choices'])
@ddt.ddt
class TestMentoringBlock(BlockWithChildrenTestMixin, unittest.TestCase): class TestMentoringBlock(BlockWithChildrenTestMixin, unittest.TestCase):
def test_sends_progress_event_when_rendered_student_view_with_display_submit_false(self): def test_sends_progress_event_when_rendered_student_view_with_display_submit_false(self):
block = MentoringBlock(MagicMock(), DictFieldData({ block = MentoringBlock(MagicMock(), DictFieldData({
......
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