def test_deferredRendering(self):
        """
        An Element with a render method which returns a Deferred will render
        correctly.
        """
        class RenderfulElement(Element):
            @renderer
            def renderMethod(self, request, tag):
                return succeed("Hello, world.")
        element = RenderfulElement(loader=XMLString("""
        <p xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1"
          t:render="renderMethod">
            Goodbye, world.
        </p>
        """))
        return self.assertFlattensTo(element, b"Hello, world.")

        An Element with a render method which returns a Deferred will render
        correctly.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_template.py