'test %calls that are chained through their targets'

def test_chained_call(self):

    t = Template('\n                                                <%def    name="a()">\n                                                                this    is    a.\n                                                                <%call    expr="b()">\n                                                                                this    is    a\'s    ccall.        heres    my    body:    ${caller.body()}\n                                                                </%call>\n                                                </%def>\n                                                <%def    name="b()">\n                                                                this    is    b.        heres        my    body:    ${caller.body()}\n                                                                whats    in    the    body\'s    caller\'s    body    ?\n                                                                ${context.caller_stack[-2].body()}\n                                                </%def>\n\n                                                <%call    expr="a()">\n                                                                heres    the    main    templ    call\n                                                </%call>\n\n')
    assert (result_lines(t.render()) == ['this    is    a.', 'this    is    b.    heres    my    body:', "this    is    a's    ccall.    heres    my    body:", 'heres    the    main    templ    call', "whats    in    the    body's    caller's    body    ?", 'heres    the    main    templ    call'])
