'Helper method for testing context based on the provided XML string.'

def _render_context_test(self, xml_str, expected_context):

    element = etree.fromstring(xml_str)
    state = {'value': 103, 'response_data': RESPONSE_DATA}
    the_input = lookup_tag('jsinput')(test_capa_system(), element, state)
    context = the_input._get_render_context()
    full_expected_context = {'STATIC_URL': '/dummy-static/', 'id': 'prob_1_2', 'status': inputtypes.Status('unanswered'), 'describedby_html': DESCRIBEDBY.format(status_id='prob_1_2'), 'msg': '', 'params': None, 'jschannel_loader': '/dummy-static/js/capa/src/jschannel.js', 'jsinput_loader': '/dummy-static/js/capa/src/jsinput.js', 'saved_state': 103, 'response_data': RESPONSE_DATA, 'value': 103}
    full_expected_context.update(expected_context)
    self.assertEqual(full_expected_context, context)
