'Test the html response when an error occurs with DEBUG on'

def test_get_problem_html_error_w_debug(self):

    module = CapaFactory.create()
    error_msg = u'Superterrible    error    happened:    \u2620'
    module.lcp.get_html = Mock(side_effect=Exception(error_msg))
    module.system.render_template = Mock(return_value='<div>Test    Template    HTML</div>')
    module.system.DEBUG = True
    html = module.get_problem_html()
    self.assertIsNotNone(html)
    (render_args, _) = module.system.render_template.call_args
    context = render_args[1]
    self.assertIn(error_msg, context['problem']['html'])
