def test_noneDoctype(self):
        """
        L{renderElement} will not write out a doctype if the doctype keyword
        argument is L{None}.
        """
        element = TestElement()

        d = self.request.notifyFinish()

        def check(_):
            self.assertEqual(
                b"".join(self.request.written),
                b'<p>Hello, world.</p>')

        d.addCallback(check)

        renderElement(self.request, element, doctype=None)

        return d

        L{renderElement} will not write out a doctype if the doctype keyword
        argument is L{None}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_template.py