'test that \'caller\' is non-None only if the immediate <%def> was called via <%call>'

def test_conditional_call(self):

    t = Template('\n                                <%def    name="a()">\n                                %    if    caller:\n                                ${    caller.body()    }    \\\n                                %    endif\n                                AAA\n                                ${    b()    }\n                                </%def>\n\n                                <%def    name="b()">\n                                %    if    caller:\n                                ${    caller.body()    }    \\\n                                %    endif\n                                BBB\n                                ${    c()    }\n                                </%def>\n\n                                <%def    name="c()">\n                                %    if    caller:\n                                ${    caller.body()    }    \\\n                                %    endif\n                                CCC\n                                </%def>\n\n                                <%call    expr="a()">\n                                CALL\n                                </%call>\n\n                                ')
    assert (result_lines(t.render()) == ['CALL', 'AAA', 'BBB', 'CCC'])
