Ϫf@dZddlmZddlmZddlmZddlmZddl m Z m Z m Z ddl mZddlmZd ed efd ZGd d eZy)z Test L{twisted.web.pages} )cast)SynchronousTestCase)Headers)IRequest) errorPage forbiddennotFound) IResource) DummyRequestresourcereturnc\tdg}|jtt||S)z Render a response using the given resource. @param resource: The resource to use to handle the request. @returns: The request that the resource handled, )r renderrr)r requests =/usr/lib/python3/dist-packages/twisted/web/test/test_pages.py_renderrs*C5!G OOD7+, NrcLeZdZdZdZdedededdfdZd dZ d d Z d d Z d d Z y) ErrorPageTestszu Test L{twisted.web.pages._ErrorPage} and its public aliases L{errorPage}, L{notFound} and L{forbidden}. Nrcodebodyr c|j|j||j|jtddgi|jdj |j j d|j dy)Ns content-typestext/html; charset=utf-8rzlatin-1) assertEqual responseCoderesponseHeadersrjoinwrittendecode)selfrrrs rassertResponsezErrorPageTests.assertResponse*sy --t4   # # _'B&CD E   HHW__ % , ,Y 7 KK "  rc R|jttdddddy)zS The I{brief} and I{detail} parameters are HTML-escaped on render. izA & Bz