'test %calls that are nested inside each other'

def test_nested_call(self):

    t = Template('\n                                                <%def    name="foo()">\n                                                                ${caller.body(x=10)}\n                                                </%def>\n\n                                                x    is    ${x}\n                                                <%def    name="bar()">\n                                                                bar:    ${caller.body()}\n                                                </%def>\n\n                                                <%call    expr="foo()"    args="x">\n                                                                this    is    foo    body:    ${x}\n\n                                                                <%call    expr="bar()">\n                                                                                this    is    bar    body:    ${x}\n                                                                </%call>\n                                                </%call>\n')
    assert (result_lines(t.render(x=5)) == ['x    is    5', 'this    is    foo    body:    10', 'bar:', 'this    is    bar    body:    10'])
