devtools/testlib.py
changeset 10755 4c48d3bab38c
parent 10700 a6d9d27f4253
child 10837 b71511460a4f
equal deleted inserted replaced
10754:03aa9f2a4ecb 10755:4c48d3bab38c
   979 
   979 
   980     @nocoverage
   980     @nocoverage
   981     def _check_html(self, output, view, template='main-template'):
   981     def _check_html(self, output, view, template='main-template'):
   982         """raises an exception if the HTML is invalid"""
   982         """raises an exception if the HTML is invalid"""
   983         output = output.strip()
   983         output = output.strip()
       
   984         if isinstance(output, text_type):
       
   985             # XXX
       
   986             output = output.encode('utf-8')
   984         validator = self.get_validator(view, output=output)
   987         validator = self.get_validator(view, output=output)
   985         if validator is None:
   988         if validator is None:
   986             return output # return raw output if no validator is defined
   989             return output # return raw output if no validator is defined
   987         if isinstance(validator, htmlparser.DTDValidator):
   990         if isinstance(validator, htmlparser.DTDValidator):
   988             # XXX remove <canvas> used in progress widget, unknown in html dtd
   991             # XXX remove <canvas> used in progress widget, unknown in html dtd