'L{renderElement} will render a traceback when rendering of
the element fails and our site is configured to display tracebacks.'

def test_simpleFailureWithTraceback(self):

    self.request.site.displayTracebacks = True
    element = FailingElement()
    d = self.request.notifyFinish()
    def check(_):
        flushed = self.flushLoggedErrors(FlattenerError)
        self.assertEqual(len(flushed), 1)
        self.assertEqual(''.join(self.request.written), '<!DOCTYPE    html>\n<p>I    failed.</p>')
        self.assertTrue(self.request.finished)
    d.addCallback(check)
    renderElement(self.request, element, _failElement=TestFailureElement)
    return d
