Add test for html_escape on non-strings

If escape_html is set, the argument passed to html_escape is not
necessarily a string (in the generated code it is passed before being
interpolated).

Add test to check html_escape converts non-strings.

See #673