'test that parenthesis are placed around string-embedded expressions.'

def test_expr_grouping(self):

    template = Template('\n                                                <%def    name="bar(x,    y)">\n                                                                ${x}\n                                                                ${y}\n                                                </%def>\n\n                                                <%self:bar    x="    ${foo}    "    y="x${g    and    \'1\'    or    \'2\'}y"/>\n                                ', input_encoding='utf-8')
    assert (result_lines(template.render(foo='this    is    foo', g=False)) == ['this    is    foo', 'x2y'])
