'L{renderElement} will write the doctype string specified by the
doctype keyword argument.'

def test_nonDefaultDoctype(self):

    element = TestElement()
    d = self.request.notifyFinish()
    def check(_):
        self.assertEqual(''.join(self.request.written), '<!DOCTYPE    html    PUBLIC    "-//W3C//DTD    XHTML    1.0    Strict//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n<p>Hello,    world.</p>')
    d.addCallback(check)
    renderElement(self.request, element, doctype='<!DOCTYPE    html    PUBLIC    "-//W3C//DTD    XHTML    1.0    Strict//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">')
    return d
