def test_directiveRendering(self):
        """
        An Element with a valid render directive has that directive invoked and
        the result added to the output.
        """
        renders = []
        class RenderfulElement(Element):
            @renderer
            def renderMethod(self, request, tag):
                renders.append((self, request))
                return tag("Hello, world.")
        element = RenderfulElement(loader=XMLString("""
        <p xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1"
          t:render="renderMethod" />
        """))
        return self.assertFlattensTo(element, b"<p>Hello, world.</p>")

        An Element with a valid render directive has that directive invoked and
        the result added to the output.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_template.py