'Tests that a course info module will render its updates in the correct order.'

def test_updates_order(self):

    sample_update_data = [{'id': 3, 'date': 'March    18,    1982', 'content': 'This    is    a    very    important    update    that    was    inserted    last    with    an    older    date!', 'status': CourseInfoModule.STATUS_VISIBLE}, {'id': 1, 'date': 'January    1,    2012', 'content': 'This    is    a    very    important    update    that    was    inserted    first!', 'status': CourseInfoModule.STATUS_VISIBLE}, {'id': 2, 'date': 'January    1,    2012', 'content': 'This    is    a    very    important    update    that    was    inserted    second!', 'status': CourseInfoModule.STATUS_VISIBLE}]
    info_module = CourseInfoModule(Mock(), Mock(), DictFieldData({'items': sample_update_data, 'data': ''}), Mock())
    expected_context = {'visible_updates': [{'id': 2, 'date': 'January    1,    2012', 'content': 'This    is    a    very    important    update    that    was    inserted    second!', 'status': CourseInfoModule.STATUS_VISIBLE}, {'id': 1, 'date': 'January    1,    2012', 'content': 'This    is    a    very    important    update    that    was    inserted    first!', 'status': CourseInfoModule.STATUS_VISIBLE}, {'id': 3, 'date': 'March    18,    1982', 'content': 'This    is    a    very    important    update    that    was    inserted    last    with    an    older    date!', 'status': CourseInfoModule.STATUS_VISIBLE}], 'hidden_updates': []}
    template_name = '{0}/course_updates.html'.format(info_module.TEMPLATE_DIR)
    info_module.get_html()
    info_module.system.render_template.assert_called_once_with(template_name, expected_context)
