# HG changeset patch # User Julien Cristau # Date 1443694514 -7200 # Node ID 4c48d3bab38c419158f1c8f00906f58c5e4b9cc1 # Parent 03aa9f2a4ecb77549d18bee7d5eac51369f5b7dd [devtools] CubicWebTC._check_html may have to deal with unicode or bytes If called with template=None, CubicWebTC.view will not go through main-template, and return the unicode data from the view directly instead of encoded data. diff -r 03aa9f2a4ecb -r 4c48d3bab38c devtools/testlib.py --- a/devtools/testlib.py Thu Oct 01 12:02:02 2015 +0200 +++ b/devtools/testlib.py Thu Oct 01 12:15:14 2015 +0200 @@ -981,6 +981,9 @@ def _check_html(self, output, view, template='main-template'): """raises an exception if the HTML is invalid""" output = output.strip() + if isinstance(output, text_type): + # XXX + output = output.encode('utf-8') validator = self.get_validator(view, output=output) if validator is None: return output # return raw output if no validator is defined