diff --git a/common/lib/capa/capa/tests/test_inputtypes.py b/common/lib/capa/capa/tests/test_inputtypes.py index 4a4c6ee5bc..58b0bb2f9f 100644 --- a/common/lib/capa/capa/tests/test_inputtypes.py +++ b/common/lib/capa/capa/tests/test_inputtypes.py @@ -508,17 +508,24 @@ class DragAndDropTest(unittest.TestCase): ''' def test_rendering(self): - height = '12' - width = '33' - template = "path to template" - images = "list of pathes to images" + path_to_images = '/static/images/' - xml_str = """""".format(h=height, w=width, t=template, i=images) + xml_str = """ + + + + + + + + + + + + + + + """.format(path=path_to_images) element = etree.fromstring(xml_str) @@ -529,15 +536,26 @@ class DragAndDropTest(unittest.TestCase): the_input = lookup_tag('drag_and_drop_input')(test_system, element, state) context = the_input._get_render_context() - expected = {'id': 'prob_1_2', 'value': value, 'status': 'unsubmitted', + 'course_folder': 'mock', 'msg': '', - 'width': width, - 'height': height, - 'template': template, - 'images': images, - } - + 'drag_and_drop_json': '{"use_targets": "True", \ +"target_outline": "false", "one_per_target": "True", \ +"draggables": [{"label": "Label 1", "id": "1", "icon": ""}, \ +{"label": "cc", "id": "name_with_icon", "icon": \ +"/static/images/cc.jpg"}, {"label": "arrow-left", "id": \ +"with_icon", "icon": "/static/images/arrow-left.png"}, \ +{"label": "Label2", "id": "5", "icon": ""}, {"label": \ +"Mute", "id": "2", "icon": "/static/images/mute.png"}, \ +{"label": "spinner", "id": "name_label_icon3", "icon": \ +"/static/images/spinner.gif"}, {"label": "Star", "id": \ +"name4", "icon": "/static/images/volume.png"}, {"label": \ +"Label3", "id": "7", "icon": ""}], "base_image": \ +"/static/images/about_1.png", "targets": \ +[{"y": "90", "x": "210", "id": "t1", "w": "90", "h": "90"}, \ +{"y": "160", "x": "370", "id": "t2", "w": "90", "h": "90"}]}', + } + # import ipdb; ipdb.set_trace() self.assertEqual(context, expected)