'In production, when an error occurs with the problem HTML
rendering, a "dummy" problem is created with an error
message to display to the user.'

def test_get_problem_html_error(self):

    module = CapaFactory.create()
    original_problem = module.lcp
    module.lcp.get_html = Mock(side_effect=Exception('Test'))
    module.system.render_template = Mock(return_value='<div>Test    Template    HTML</div>')
    module.system.DEBUG = False
    html = module.get_problem_html()
    self.assertIsNotNone(html)
    (render_args, _) = module.system.render_template.call_args
    context = render_args[1]
    self.assertIn('error', context['problem']['html'])
    self.assertNotEqual(original_problem, module.lcp)
