devtools/testlib.py
branchstable
changeset 6979 a8fbcf9b6572
parent 6978 cac71b8a8711
child 6980 8e59c2cdcc99
child 7038 fe0afc4e8ebb
equal deleted inserted replaced
6978:cac71b8a8711 6979:a8fbcf9b6572
   772     @nocoverage
   772     @nocoverage
   773     def _check_html(self, output, view, template='main-template'):
   773     def _check_html(self, output, view, template='main-template'):
   774         """raises an exception if the HTML is invalid"""
   774         """raises an exception if the HTML is invalid"""
   775         output = output.strip()
   775         output = output.strip()
   776         validator = self.get_validator(view, output=output)
   776         validator = self.get_validator(view, output=output)
       
   777         if validator is None:
       
   778             return
   777         if isinstance(validator, htmlparser.DTDValidator):
   779         if isinstance(validator, htmlparser.DTDValidator):
   778             # XXX remove <canvas> used in progress widget, unknown in html dtd
   780             # XXX remove <canvas> used in progress widget, unknown in html dtd
   779             output = re.sub('<canvas.*?></canvas>', '', output)
   781             output = re.sub('<canvas.*?></canvas>', '', output)
   780         return self.assertWellFormed(validator, output.strip(), context= view.__regid__)
   782         return self.assertWellFormed(validator, output.strip(), context= view.__regid__)
   781 
   783