'Verify that the render context matches the expected render context with trailing_text'

def test_trailing_text_rendering(self):

    size = '42'
    trailing_text = []
    trailing_text.append(('m/s', 'm/s'))
    trailing_text.append((u'\xc3', u'\xc3'))
    trailing_text.append(('a    &lt;    b', 'a    <    b'))
    for (xml_text, expected_text) in trailing_text:
        xml_str = u'<formulaequationinput    id="prob_1_2"\n                                                                                                                size="{size}"\n                                                                                                                trailing_text="{tt}"\n                                                                                                                />'.format(size=size, tt=xml_text)
        element = etree.fromstring(xml_str)
        state = {'value': 'x^2+1/2', 'response_data': RESPONSE_DATA}
        the_input = lookup_tag('formulaequationinput')(test_capa_system(), element, state)
        context = the_input._get_render_context()
        prob_id = 'prob_1_2'
        expected = {'STATIC_URL': '/dummy-static/', 'id': prob_id, 'value': 'x^2+1/2', 'status': inputtypes.Status('unanswered'), 'msg': '', 'size': size, 'previewer': '/dummy-static/js/capa/src/formula_equation_preview.js', 'inline': False, 'trailing_text': expected_text, 'response_data': RESPONSE_DATA, 'describedby_html': TRAILING_TEXT_DESCRIBEDBY.format(trailing_text_id=prob_id, status_id=prob_id)}
        self.assertEqual(context, expected)
