'test calling a def from the top level'

def test_toplevel(self):

    template = Template('\n\n                                                this    is    the    body\n\n                                                <%def    name="a()">\n                                                                this    is    a\n                                                </%def>\n\n                                                <%def    name="b(x,    y)">\n                                                                this    is    b,    ${x}    ${y}\n                                                </%def>\n\n                                ')
    self._do_test(template.get_def('a'), 'this    is    a', filters=flatten_result)
    self._do_test(template.get_def('b'), 'this    is    b,    10    15', template_args={'x': 10, 'y': 15}, filters=flatten_result)
    self._do_test(template.get_def('body'), 'this    is    the    body', filters=flatten_result)
    self._do_test(template.get_def('a'), 'this    is    a', filters=flatten_result, template_args={'q': 5, 'zq': 'test'})
