+
    Dfjq                        R t ^ RIt^ RIHt ^ RIHtHt ^ RIHt ^ RI	H
t
 ^ RIHtHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ^ RIHt ^ RIHtHtH t  ^ RI!H"t"H#t# ^ RI$H%t% ^ RI&H't'H(t(H)t)H*t*H+t+H,t,H-t-H.t.H/t/ ^ RI0H1t1 ^ RI2H3t3 ]! ]4RR7      t5 ! R R]4      t6 ! R R]4      t7 ! R R]4      t8 ! R R4      t9 ! R R]]94      t: ! R  R!]]94      t; ! R" R#]]94      t< ! R$ R%]]94      t= ! R& R']14      t> ! R( R)]14      t? ! R* R+]'4      t@ ! R, R-]'4      tA ! R. R/]'4      tB ! R0 R14      tC]! ]"4       ! R2 R3]34      4       tD ! R4 R5]4      tER# )6z#
Tests for L{twisted.web.template}
N)StringIO)ListOptional)implementer)verifyObject)Deferredsucceed)EventLoggingObserver)globalLogPublisher)Failure)FilePath)TestCase)suppress)UnexposedMethodError)FlattenerErrorMissingRenderMethodMissingTemplateLoader)IRequestITemplateLoader)NOT_DONE_YET)	ElementFlattenableTag	TagLoaderXMLFile	XMLStringrenderElementrenderertags)FlattenTestCase)DummyRequesthPassing filenames or file objects to XMLFile is deprecated since Twisted 12.1.  Pass a FilePath instead.)categorymessagec                   ~   a  ] tR t^/t o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR lt	Rt
V tR# )TagFactoryTestszG
Tests for L{_TagFactory} through the publicly-exposed L{tags} object.
c                   < V ^8  d   QhRR/#    returnN )format__classdict__s   "@/usr/lib/python3/dist-packages/twisted/web/test/test_template.py__annotate__TagFactoryTests.__annotate__4   s     + + +    c                ^    \         P                  pV P                  VP                  R4       R# )z-
HTML tags can be retrieved through C{tags}.
aN)r   r2   assertEqualtagNameselftags   & r-   test_lookupTagTagFactoryTests.test_lookupTag4   s!     ffc*r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r/   ;   s     / /T /r0   c                ^    \         P                  pV P                  VP                  R4       R# )zR
Twisted supports the latest and greatest HTML tags from the HTML5
specification.
videoN)r   r<   r3   r4   r5   s   & r-   test_lookupHTML5Tag#TagFactoryTests.test_lookupHTML5Tag;   s!    
 jjg.r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r/   C   s     * *4 *r0   c                ^    \         P                  pV P                  VP                  R4       R# )z
To support transparent inclusion in templates, there is a special tag,
the transparent tag, which has no name of its own but is accessed
through the "transparent" attribute.
 N)r   transparentr3   r4   r5   s   & r-   test_lookupTransparentTag)TagFactoryTests.test_lookupTransparentTagC   s#     b)r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r/   L   s     D Dt Dr0   c                F    V P                  \        \        \        R4       R# )z^
Invalid tags which are not part of HTML cause AttributeErrors when
accessed through C{tags}.
invalidNassertRaisesAttributeErrorgetattrr   r6   s   &r-   test_lookupInvalidTag%TagFactoryTests.test_lookupInvalidTagL   s    
 	.'4Cr0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r/   S   s     @ @ @r0   c                F    V P                  \        \        \        R4       R# )zy
As a special case, the <xmp> tag is simply not available through
C{tags} or any other part of the templating machinery.
xmpNrH   rL   s   &r-   test_lookupXMPTagFactoryTests.test_lookupXMPS   s    
 	.'4?r0   r*   N)__name__
__module____qualname____firstlineno____doc__r8   r=   rC   rM   rR   __static_attributes____classdictcell__r,   s   @r-   r%   r%   /   s@     + +/ /* *D D@ @r0   r%   c                      a  ] tR t^[t o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR lt	V 3R lR lt
V 3R lR ltV 3R lR ltRtV tR# )ElementTestsz-
Tests for the awesome new L{Element} class.
c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   ElementTests.__annotate__`   s     3 3D 3r0   c                    \        4       pV P                  \        VP                  R4      pV P	                  VP
                  V4       R# )zZ
L{Element.render} raises L{MissingTemplateLoader} if the C{loader}
attribute is L{None}.
N)r   rI   r   renderassertIdenticalelementr6   rc   errs   &  r-   test_missingTemplateLoader'ElementTests.test_missingTemplateLoader`   s8    
 ) 5w~~tLS[['2r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r_   i   s     
 
 
r0   c           	     v     ! R R\         4      pV P                  R\        \        V! 4       4      4      4       R# )zD
A L{MissingTemplateLoader} instance can be repr()'d without error.
c                   2   a  ] tR t^nt o V 3R lR ltRtV tR# )FElementTests.test_missingTemplateLoaderRepr.<locals>.PrettyReprElementc                    < V ^8  d   QhRS[ /# r(   r)   str)r+   r,   s   "r-   r.   SElementTests.test_missingTemplateLoaderRepr.<locals>.PrettyReprElement.__annotate__o        - -# -r0   c                    R # Pretty Repr Elementr*   rL   s   &r-   __repr__OElementTests.test_missingTemplateLoaderRepr.<locals>.PrettyReprElement.__repr__o       ,r0   r*   NrT   rU   rV   rW   ru   rY   rZ   r[   s   @r-   PrettyReprElementrk   n        - -r0   ry   rt   N)r   assertInreprr   )r6   ry   s   & r-   test_missingTemplateLoaderRepr+ElementTests.test_missingTemplateLoaderRepri   s0    
	- 	- 	!4(=>O>Q(R#S	
r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r_   v   s     0 0D 0r0   c                    \        4       pV P                  \        VP                  R4      pV P	                  VP
                  V4       V P                  VP                  R4       R# )z
When called with the name which is not associated with a render method,
L{Element.lookupRenderMethod} raises L{MissingRenderMethod}.
fooN)r   rI   r   lookupRenderMethodrb   rc   r3   
renderNamerd   s   &  r-   test_missingRendererMethod'ElementTests.test_missingRendererMethodv   sO    
 ) 3W5O5OQVWS[['2/r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r_      s     + +d +r0   c                     ! R R\         4      p\        \        V! 4       R4      4      pV P                  RV4       V P                  RV4       R# )zB
A L{MissingRenderMethod} instance can be repr()'d without error.
c                   2   a  ] tR t^t o V 3R lR ltRtV tR# )DElementTests.test_missingRenderMethodRepr.<locals>.PrettyReprElementc                    < V ^8  d   QhRS[ /# rm   rn   )r+   r,   s   "r-   r.   QElementTests.test_missingRenderMethodRepr.<locals>.PrettyReprElement.__annotate__   rq   r0   c                    R # rs   r*   rL   s   &r-   ru   MElementTests.test_missingRenderMethodRepr.<locals>.PrettyReprElement.__repr__   rw   r0   r*   Nrx   r[   s   @r-   ry   r      rz   r0   ry   expectedMethodrt   N)r   r|   r   r{   )r6   ry   ss   &  r-   test_missingRenderMethodRepr)ElementTests.test_missingRenderMethodRepr   sE    
	- 	- $%6%8:JKL+Q/&*r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r_      s     4 4d 4r0   c                     ! R R\         4      pV! 4       P                  R4      pV P                  V! R\        P                  4      R4       R# )zq
When called with the name of a defined render method,
L{Element.lookupRenderMethod} returns that render method.
c                   <   a  ] tR t^t o ]V 3R lR l4       tRtV tR# )BElementTests.test_definedRenderer.<locals>.ElementWithRenderMethodc                <   < V ^8  d   QhRS[ S[,          RS[RS[/# r(   requestr7   r)   r   r   r   r   )r+   r,   s   "r-   r.   OElementTests.test_definedRenderer.<locals>.ElementWithRenderMethod.__annotate__   s'      8H#5 C K r0   c                    R # )barr*   r6   r   r7   s   &&&r-   r   FElementTests.test_definedRenderer.<locals>.ElementWithRenderMethod.foo   s    r0   r*   N)rT   rU   rV   rW   r   r   rY   rZ   r[   s   @r-   ElementWithRenderMethodr      s      r0   r   r   Nr   )r   r   r3   r   br)r6   r   r   s   &  r-   test_definedRenderer!ElementTests.test_definedRenderer   s>    	g 	
 &'::5AT477+U3r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r_      s     ; ;T ;r0   c                   a \        \        4       ! R R4      4       o ! V3R lR\        4      pV! 4       pV P                  VP	                  R4      R.4       R# )zQ
L{Element.render} loads a document from the C{loader} attribute and
returns it.
c                   2   a  ] tR t^t o V 3R lR ltRtV tR# )0ElementTests.test_render.<locals>.TemplateLoaderc                0   < V ^8  d   QhRS[ S[,          /# rm   )r   r   )r+   r,   s   "r-   r.   =ElementTests.test_render.<locals>.TemplateLoader.__annotate__   s     " "d;/ "r0   c                    R .# )resultr*   rL   s   &r-   load5ElementTests.test_render.<locals>.TemplateLoader.load   s
     z!r0   r*   N)rT   rU   rV   rW   r   rY   rZ   r[   s   @r-   TemplateLoaderr      s     " "r0   r   c                   (   < ] tR t^t Z ! 4       tRtR# )-ElementTests.test_render.<locals>.StubElementr*   N)rT   rU   rV   rW   loaderrY   )r   s   r-   StubElementr      s    #%Fr0   r   Nr   )r   r   r   r3   ra   )r6   r   rc   r   s   &  @r-   test_renderElementTests.test_render   sQ     
_	%	" 	" 
&	"	&' 	& --z:r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r_      s      T r0   c                    V P                  \        \        4      p\        P                  R8  d   V P                  \        V4      R4       R# V P                  \        V4      R4       R# )zj
If the L{renderer} decorator  is called without any arguments, it will
raise a comprehensible exception.
z=Expose.__call__() missing 1 required positional argument: 'f'z6__call__() missing 1 required positional argument: 'f'N)   
   )rI   	TypeErrorr   sysversion_infor3   ro   )r6   tes   & r-   test_misuseRenderer ElementTests.test_misuseRenderer   sV    
 y(3w&BX BQr0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r_      s     T TT Tr0   c                R    V P                  \        \        P                  RR4       R# )zt
Called directly, without a default, L{renderer.get} raises
L{UnexposedMethodError} when it cannot find a renderer.
NnotARenderer)rI   r   r   getrL   s   &r-   test_renderGetDirectlyError(ElementTests.test_renderGetDirectlyError   s    
 	.dNSr0   r*   N)rT   rU   rV   rW   rX   rf   r}   r   r   r   r   r   r   rY   rZ   r[   s   @r-   r]   r]   [   s\     3 3
 
0 0+ +4 4; ;" T Tr0   r]   c                   z   a  ] tR t^t o RtV 3R lR ltV 3R lR lt].]n        V 3R lR lt	].]	n        Rt
V tR	# )
XMLFileReprTestsz:
Tests for L{twisted.web.template.XMLFile}'s C{__repr__}.
c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   XMLFileReprTests.__annotate__   s     H Ht Hr0   c                n    \        R4      pV P                  RV: R2\        \        V4      4      4       R# )z;
An L{XMLFile} with a L{FilePath} returns a useful repr().
/tmp/fake.xml<XMLFile of >N)r   r3   r|   r   )r6   paths   & r-   test_filePathXMLFileReprTests.test_filePath   s0     (<xq143FGr0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r      s     J Jt Jr0   c                \    RpV P                  RV: R2\        \        V4      4      4       R# )z8
An L{XMLFile} with a filename returns a useful repr().
r   r   r   N)r3   r|   r   )r6   fnames   & r-   test_filenameXMLFileReprTests.test_filename   s+      <y2D4HIr0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r      s     H H4 Hr0   c                n    \        R4      pV P                  RV: R2\        \        V4      4      4       R# )z;
An L{XMLFile} with a file object returns a useful repr().
znot xmlr   r   N)r   r3   r|   r   )r6   fobjs   & r-   	test_fileXMLFileReprTests.test_file   s0     	"<xq143FGr0   r*   N)rT   rU   rV   rW   rX   r   r   _xmlFileSuppressr   r   rY   rZ   r[   s   @r-   r   r      sK     H HJ J //MH H ++Ir0   r   c                   z   a  ] tR t^t o  Rt V 3R lR ltV 3R lR ltV 3R lR lt].]n	        V 3R lt
R	tV tR
# )XMLLoaderTestsMixin<p>Hello, world.</p>c                    < V ^8  d   QhRS[ /# rm   r   )r+   r,   s   "r-   r.    XMLLoaderTestsMixin.__annotate__   s     " " "r0   c                    \         hN)NotImplementedErrorrL   s   &r-   loaderFactory!XMLLoaderTestsMixin.loaderFactory   s    !!r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r      s     : :4 :r0   c                p   \        V \        4      '       g   Q hV P                  4       pVP                  4       w  p\        V\        4      '       g   Q hV P                  V P                  .R7      pV P                  '       da   V P                  \        V4      ^4       V P                  V^ ,          R,          \        4       V P                  V^ ,          R,          R4       MV P                  \        V4      ^ 4       V P                  VP                  R4       V P                  VP                  R.4       R# )zA
Verify that the loader returns a tag with the correct children.
)offendingFunctionsr"   r#   r!   pHello, world.N)
isinstancer   r   r   r   flushWarningsdeprecatedUser3   lenDeprecationWarningr4   children)r6   r   r7   warningss   &   r-   	test_loadXMLLoaderTestsMixin.test_load   s     $))))##%#s####%%$:L:L9M%NS]A.Xa[46HII&K S]A.c*'89r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r   	  s     	' 	' 	'r0   c                    \        V \        4      '       g   Q hV P                  4       pVP                  4       pVP                  4       pV P	                  W#4       R# )zL
If {load()} can be called on a loader twice the result should be the
same.
N)r   r   r   r   r3   )r6   r   tags1tags2s   &   r-   test_loadTwice"XMLLoaderTestsMixin.test_loadTwice	  sI    
 $))))##%&r0   c                &   < V ^8  d   Qh/ S[ ;R&   # )r(   r   )bool)r+   r,   s   "r-   r.   r      s      r0   r*   N)rT   rU   rV   rW   templateStringr   r   r   r   r   __annotate_func__rY   rZ   r[   s   @r-   r   r      sI     
 ,N" ": :0	' 	'  00Ne  r0   r   c                   :   a  ] tR tRt o RtRtV 3R lR ltRtV tR# )XMLStringLoaderTestsi  z-
Tests for L{twisted.web.template.XMLString}
Fc                    < V ^8  d   QhRS[ /# rm   r   )r+   r,   s   "r-   r.   !XMLStringLoaderTests.__annotate__  s     . . .r0   c                ,    \        V P                  4      # )zC
@return: an L{XMLString} constructed with C{self.templateString}.
)r   r   rL   s   &r-   r   "XMLStringLoaderTests.loaderFactory  s     ,,--r0   r*   N	rT   rU   rV   rW   rX   r   r   rY   rZ   r[   s   @r-   r   r     s      M. .r0   r   c                   :   a  ] tR tRt o RtRtV 3R lR ltRtV tR# )XMLFileWithFilePathTestsi%  zB
Tests for L{twisted.web.template.XMLFile}'s L{FilePath} support.
Fc                    < V ^8  d   QhRS[ /# rm   r   )r+   r,   s   "r-   r.   %XMLFileWithFilePathTests.__annotate__,  s       r0   c                    \        V P                  4       4      pVP                  V P                  P	                  R4      4       \        V4      # )zv
@return: an L{XMLString} constructed with a L{FilePath} pointing to a
    file that contains C{self.templateString}.
utf8)r   mktemp
setContentr   encoder   r6   fps   & r-   r   &XMLFileWithFilePathTests.loaderFactory,  s;    
 dkkm$
d))0089r{r0   r*   Nr  r[   s   @r-   r  r  %  s      M r0   r  c                   :   a  ] tR tRt o RtRtV 3R lR ltRtV tR# )XMLFileWithFileTestsi6  zM
Tests for L{twisted.web.template.XMLFile}'s deprecated file object support.
Tc                    < V ^8  d   QhRS[ /# rm   r   )r+   r,   s   "r-   r.   !XMLFileWithFileTests.__annotate__=  s     6 6 6r0   c                >    \        \        V P                  4      4      # )zc
@return: an L{XMLString} constructed with a file object that contains
    C{self.templateString}.
)r   r   r   rL   s   &r-   r   "XMLFileWithFileTests.loaderFactory=  s    
 x 3 3455r0   r*   Nr  r[   s   @r-   r  r  6  s      M6 6r0   r  c                   :   a  ] tR tRt o RtRtV 3R lR ltRtV tR# )XMLFileWithFilenameTestsiE  zJ
Tests for L{twisted.web.template.XMLFile}'s deprecated filename support.
Tc                    < V ^8  d   QhRS[ /# rm   r   )r+   r,   s   "r-   r.   %XMLFileWithFilenameTests.__annotate__L  s          r0   c                    \        V P                  4       4      pVP                  V P                  P	                  R4      4       \        VP                  4      # )zs
@return: an L{XMLString} constructed with a filename that points to a
    file containing C{self.templateString}.
r	  )r   r
  r  r   r  r   r   r  s   & r-   r   &XMLFileWithFilenameTests.loaderFactoryL  s@    
 dkkm$
d))0089rwwr0   r*   Nr  r[   s   @r-   r  r  E  s      M   r0   r  c                   h  a  ] tR tRt o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R	 lR
 ltV 3R lR lt	V 3R lR lt
V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR  ltV 3R! lR" ltV 3R# lR$ ltV 3R% lR& ltR'tV tR(# ))FlattenIntegrationTestsiV  zO
Tests for integration between L{Element} and
L{twisted.web._flatten.flatten}.
c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   $FlattenIntegrationTests.__annotate__\  s     P P Pr0   c                j    . ROpV F(  pV P                  \        \        V4      R7      V4       K*  	  R# )z
Given a series of parsable XML strings, verify that
L{twisted.web._flatten.flatten} will flatten the L{Element} back to the
input when sent on a round trip.
r   N)   <p>Hello, world.</p>s   <p><!-- hello, world --></p>s    <p><![CDATA[Hello, world.]]></p>sB   <test1 xmlns:test2="urn:test2"><test2:test3></test2:test3></test1>s0   <test1 xmlns="urn:test2"><test3></test3></test1>
   <p>☃</p>)assertFlattensImmediatelyr   r   )r6   	fragmentsxmls   &  r-   test_roundTrip&FlattenIntegrationTests.test_roundTrip\  s.    
	 C**7)C.+I3O r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r  m  s     H Ht Hr0   c                T    \        \        R4      R7      pV P                  VR4       R# )z`
When flattening an HTML entity, it should flatten out to the utf-8
representation if possible.
z<p>&#9731;</p>r!  r#  Nr   r   r$  r6   rc   s   & r-   test_entityConversion-FlattenIntegrationTests.test_entityConversionm  s%    
 +;!<=&&w0FGr0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r  u  s     F FD Fr0   c                B    V P                  \        4       \        4       R# )zS
Rendering an Element without a loader attribute raises the appropriate
exception.
N)assertFlatteningRaisesr   r   rL   s   &r-   rf   2FlattenIntegrationTests.test_missingTemplateLoaderu  s    
 	##GI/DEr0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r  |  s     B B$ Br0   c                \    \        \        R4      R7      pV P                  V\        4       R# )z
Flattening an L{Element} with a C{loader} which has a tag with a render
directive fails with L{FlattenerError} if there is no available render
method to satisfy that directive.
zy
        <p xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1"
          t:render="unknownMethod" />
        r!  N)r   r   r1  r   r,  s   & r-   test_missingRenderMethod0FlattenIntegrationTests.test_missingRenderMethod|  s.     
 	##G-@Ar0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r    s     B B4 Br0   c                T    \        \        R4      R7      pV P                  VR4       R# )z_
A C{transparent} element should be eliminated from the DOM and rendered as
only its children.
zk<t:transparent xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1">Hello, world.</t:transparent>r!     Hello, world.Nr+  r,  s   & r-   test_transparentRendering1FlattenIntegrationTests.test_transparentRendering  s.    
 #
 	&&w0@Ar0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r    s     
 
D 
r0   c                T    \        \        R4      R7      pV P                  VR4       R# )zf
An Element with an attr tag renders the vaule of its attr tag as an
attribute of its containing tag.
z<a xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1"><t:attr name="href">http://example.com</t:attr>Hello, world.</a>r!  s.   <a href="http://example.com">Hello, world.</a>Nr+  r,  s   & r-   test_attrRendering*FlattenIntegrationTests.test_attrRendering  s1    
 
 	&&F	
r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r    s     W W4 Wr0   c                x    T P                  \        ^4       Uu. uF  p\        R4      NK  	  upR4       R# u upi )z~
When rendering a large number of already-fired Deferreds we should not
encounter any recursion errors or stack-depth issues.
xNs   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)r$  ranger   )r6   is   & r-   !test_synchronousDeferredRecursion9FlattenIntegrationTests.test_synchronousDeferredRecursion  s.    
 	&&eCj'Ijj'I:V'Is   7c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r    s     
 
 
r0   c                <    V P                  \        \        R4       R# )zc
A template with a toplevel C{attr} tag will not load; it will raise
L{AssertionError} if you try.
z<t:attr
            xmlns:t='http://twistedmatrix.com/ns/twisted.web.template/0.1'
            name='something'
            >hello</t:attr>
            NrI   AssertionErrorr   rL   s   &r-   test_errorToplevelAttr.FlattenIntegrationTests.test_errorToplevelAttr  s    
 		
r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r    s     
 
t 
r0   c                <    V P                  \        \        R4       R# )zu
A template with an C{attr} tag with no C{name} attribute will not load;
it will raise L{AssertionError} if you try.
z{<html><t:attr
            xmlns:t='http://twistedmatrix.com/ns/twisted.web.template/0.1'
            >hello</t:attr></html>NrI  rL   s   &r-   test_errorUnnamedAttr-FlattenIntegrationTests.test_errorUnnamedAttr  s    
 	&	
r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r    s     @ @D @r0   c                t    Rp\        \        V4      R7      pV P                  W!P                  R4      4       R# )zp
If the parser sees a prefix it doesn't recognize on an attribute, it
will pass it on through to serialization.
z}<hello:world hello:sample="testing" xmlns:hello="http://made-up.example.com/ns/not-real">This is a made-up tag.</hello:world>r!  r	  N)r   r   assertFlattensTor  )r6   theInputrc   s   &  r-   test_lenientPrefixBehavior2FlattenIntegrationTests.test_lenientPrefixBehavior  s4    3 	
 8!45gv'>?r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r    s     B B Br0   c                l     ! R R\         4      pV! \        R4      R7      pV P                  VR4       R# )zQ
An Element with a render method which returns a Deferred will render
correctly.
c                   <   a  ] tR tRt o ]V 3R lR l4       tRtV tR# )HFlattenIntegrationTests.test_deferredRendering.<locals>.RenderfulElementi  c                <   < V ^8  d   QhRS[ S[,          RS[RS[/# r   r   )r+   r,   s   "r-   r.   UFlattenIntegrationTests.test_deferredRendering.<locals>.RenderfulElement.__annotate__  s*     0 0'108;00r0   c                    \        R 4      # r   )r   r   s   &&&r-   renderMethodUFlattenIntegrationTests.test_deferredRendering.<locals>.RenderfulElement.renderMethod  s     //r0   r*   NrT   rU   rV   rW   r   r_  rY   rZ   r[   s   @r-   RenderfulElementrZ    s     0 0r0   rb  
        <p xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1"
          t:render="renderMethod">
            Goodbye, world.
        </p>
        r!  r9  Nr+  r6   rb  rc   s   &  r-   test_deferredRendering.FlattenIntegrationTests.test_deferredRendering  s:    	0w 	0 #	
 	&&w0@Ar0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r    s     	N 	N4 	Nr0   c                R     ! R R\         4      pV P                  V! 4       R4       R# )z
If there is a non-None loader attribute on the class of an Element
instance but none on the instance itself, the class attribute is used.
c                   &    ] tR tRt]! R4      tRtR# )EFlattenIntegrationTests.test_loaderClassAttribute.<locals>.SubElementi  r   r*   N)rT   rU   rV   rW   r   r   rY   r*   r0   r-   
SubElementrj    s    56Fr0   rk  r"  N)r   r$  )r6   rk  s   & r-   test_loaderClassAttribute1FlattenIntegrationTests.test_loaderClassAttribute  s#    	7 	7 	&&z|5LMr0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r     s     I I Ir0   c                x   a . o ! V3R lR\         4      pV! \        R4      R7      pV P                  VR4       R# )zi
An Element with a valid render directive has that directive invoked and
the result added to the output.
c                   D   <a  ] tR tRt o ]V 3R lV3R ll4       tRtV tR# )IFlattenIntegrationTests.test_directiveRendering.<locals>.RenderfulElementi  c                <   < V ^8  d   QhRS[ S[,          RS[RS[/# r   r   )r+   r,   s   "r-   r.   VFlattenIntegrationTests.test_directiveRendering.<locals>.RenderfulElement.__annotate__	  s*     , ,'1,8;,,r0   c                8   < SP                  W34       V! R 4      # r^  )append)r6   r   r7   renderss   &&&r-   r_  VFlattenIntegrationTests.test_directiveRendering.<locals>.RenderfulElement.renderMethod  s     /?++r0   r*   Nra  )r,   rv  s   @r-   rb  rq    s     , , ,r0   rb  x
        <p xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1"
          t:render="renderMethod" />
        r!  r"  Nr+  )r6   rb  rc   rv  s   &  @r-   test_directiveRendering/FlattenIntegrationTests.test_directiveRendering   sB    
 	,w 	, #
 	&&w0GHr0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r    s     B BD Br0   c                l     ! R R\         4      pV! \        R4      R7      pV P                  VR4       R# )zo
An Element with a render method which omits the containing tag
successfully removes that tag from the output.
c                   <   a  ] tR tRt o ]V 3R lR l4       tRtV tR# )TFlattenIntegrationTests.test_directiveRenderingOmittingTag.<locals>.RenderfulElementi  c                <   < V ^8  d   QhRS[ S[,          RS[RS[/# r   r   )r+   r,   s   "r-   r.   aFlattenIntegrationTests.test_directiveRenderingOmittingTag.<locals>.RenderfulElement.__annotate__!  s*     ' ''1'8;''r0   c                    R # r^  r*   r   s   &&&r-   r_  aFlattenIntegrationTests.test_directiveRenderingOmittingTag.<locals>.RenderfulElement.renderMethod   s     'r0   r*   Nra  r[   s   @r-   rb  r~    s     ' 'r0   rb  rc  r!  r9  Nr+  rd  s   &  r-   "test_directiveRenderingOmittingTag:FlattenIntegrationTests.test_directiveRenderingOmittingTag  s:    	'w 	' #	
 	&&w0@Ar0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r  2  s     R RT Rr0   c                l     ! R R\         4      pV! \        R4      R7      pV P                  VR4       R# )\
An Element which is returned by the render method of another Element is
rendered properly.
c                   <   a  ] tR tRt o ]V 3R lR l4       tRtV tR# )UFlattenIntegrationTests.test_elementContainingStaticElement.<locals>.RenderfulElementi8  c                <   < V ^8  d   QhRS[ S[,          RS[RS[/# r   r   )r+   r,   s   "r-   r.   bFlattenIntegrationTests.test_elementContainingStaticElement.<locals>.RenderfulElement.__annotate__:  s/     P P'1P8;PPr0   c                8    V! \        \        R 4      R7      4      # )z<em>Hello, world.</em>r!  )r   r   r   s   &&&r-   r_  bFlattenIntegrationTests.test_elementContainingStaticElement.<locals>.RenderfulElement.renderMethod9  s     7)4L*MNOOr0   r*   Nra  r[   s   @r-   rb  r  8  s     P Pr0   rb  rx  r!  s   <p><em>Hello, world.</em></p>Nr+  rd  s   &  r-   #test_elementContainingStaticElement;FlattenIntegrationTests.test_elementContainingStaticElement2  s<    	Pw 	P #
 	&&w0PQr0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r  I  s     I I Ir0   c                l     ! R R\         4      pV! \        R4      R7      pV P                  VR4       R# )r  c                   <   a  ] tR tRt o ]V 3R lR l4       tRtV tR# )HFlattenIntegrationTests.test_elementUsingSlots.<locals>.RenderfulElementiO  c                <   < V ^8  d   QhRS[ S[,          RS[RS[/# r   r   )r+   r,   s   "r-   r.   UFlattenIntegrationTests.test_elementUsingSlots.<locals>.RenderfulElement.__annotate__Q  s*     5 5'158;55r0   c                &    VP                  R R7      # )zworld.)test2)	fillSlotsr   s   &&&r-   r_  UFlattenIntegrationTests.test_elementUsingSlots.<locals>.RenderfulElement.renderMethodP  s     }}8}44r0   r*   Nra  r[   s   @r-   rb  r  O  s     5 5r0   rb  z<p xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1" t:render="renderMethod"><t:slot name="test1" default="Hello, " /><t:slot name="test2" /></p>r!  r"  Nr+  rd  s   &  r-   test_elementUsingSlots.FlattenIntegrationTests.test_elementUsingSlotsI  s:    	5w 	5 #
 	&&w0GHr0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r  a  s     #I #Id #Ir0   c                   a  ! V3R lR\         4      p ! R R\         4      oV! \        R4      R7      pV P                  VR4       R# )	z
Directives in the document factory of an Element returned from a render
method of another Element are satisfied from the correct object: the
"inner" Element.
c                   D   <a  ] tR tRt o ]V 3R lV3R ll4       tRtV tR# )RFlattenIntegrationTests.test_elementContainingDynamicElement.<locals>.OuterElementih  c                <   < V ^8  d   QhRS[ S[,          RS[RS[/# r   r   )r+   r,   s   "r-   r.   _FlattenIntegrationTests.test_elementContainingDynamicElement.<locals>.OuterElement.__annotate__j  s'      8H+= C K r0   c                4   < V! S! \        R 4      R7      4      # )z
                <t:ignored
                  xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1"
                  t:render="innerMethod" />
                r!  )r   )r6   r   r7   InnerElements   &&&r-   outerMethod^FlattenIntegrationTests.test_elementContainingDynamicElement.<locals>.OuterElement.outerMethodi  s%     ( 
 
r0   r*   N)rT   rU   rV   rW   r   r  rY   rZ   )r,   r  s   @r-   OuterElementr  h  s       r0   r  c                   <   a  ] tR tRt o ]V 3R lR l4       tRtV tR# )RFlattenIntegrationTests.test_elementContainingDynamicElement.<locals>.InnerElementiw  c                <   < V ^8  d   QhRS[ S[,          RS[RS[/# r   r   )r+   r,   s   "r-   r.   _FlattenIntegrationTests.test_elementContainingDynamicElement.<locals>.InnerElement.__annotate__y  s'     ' '8H+= 'C 'K 'r0   c                    R # r^  r*   r   s   &&&r-   innerMethod^FlattenIntegrationTests.test_elementContainingDynamicElement.<locals>.InnerElement.innerMethodx  s    &r0   r*   N)rT   rU   rV   rW   r   r  rY   rZ   r[   s   @r-   r  r  w  s     ' 'r0   r  zw
        <p xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1"
          t:render="outerMethod" />
        r!  r"  Nr+  )r6   r  rc   r  s   &  @r-   $test_elementContainingDynamicElement<FlattenIntegrationTests.test_elementContainingDynamicElementa  sG    	7 		'7 	'
 
 	&&w0GHr0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r    s     #: #:d #:r0   c                   aa \        R4      o ! VV3R lR\        4      oS! 4       pS! 4       pV P                  VR4       V P                  VR4       V P                  VR4       R# )zg
Rendering the output of a loader, or even the same element, should
return different output each time.
z<p xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1"><t:transparent t:render="classCounter" /> <t:transparent t:render="instanceCounter" /></p>c                   n   <a  ] tR tRt o ^ t^ t Zt]V 3R lV3R ll4       t]V 3R lR l4       t	Rt
V tR# )HFlattenIntegrationTests.test_sameLoaderTwice.<locals>.DestructiveElementi  c                <   < V ^8  d   QhRS[ S[,          RS[RS[/# r   r   )r+   r,   s   "r-   r.   UFlattenIntegrationTests.test_sameLoaderTwice.<locals>.DestructiveElement.__annotate__  s*     : :'1:8;::r0   c                l   < S;P                   ^,          un         V! \        SP                   4      4      #    )countro   )r6   r   r7   DestructiveElements   &&&r-   classCounterUFlattenIntegrationTests.test_sameLoaderTwice.<locals>.DestructiveElement.classCounter  s-     #((A-(3177899r0   c                <   < V ^8  d   QhRS[ S[,          RS[RS[/# r   r   )r+   r,   s   "r-   r.   r    s*     4 4'148;44r0   c                j    V ;P                   ^,          un         V! \        V P                   4      4      # r  )instanceCountro   r   s   &&&r-   instanceCounterXFlattenIntegrationTests.test_sameLoaderTwice.<locals>.DestructiveElement.instanceCounter  s+     ""a'"3t11233r0   r*   N)rT   rU   rV   rW   r  r  r   r   r  r  rY   rZ   )r,   r  sharedLoaders   @r-   r  r    s?     EM!F: : : 4 4r0   r  s
   <p>1 1</p>s
   <p>2 2</p>s
   <p>3 1</p>N)r   r   r$  )r6   e1e2r  r  s   &  @@r-   test_sameLoaderTwice,FlattenIntegrationTests.test_sameLoaderTwice  sg    
 !
	4 	4 	4&  !!&&r=9&&r=9&&r=9r0   r*   N)rT   rU   rV   rW   rX   r'  r-  rf   r5  r:  r>  rE  rK  rO  rU  re  rl  ry  r  r  r  r  r  rY   rZ   r[   s   @r-   r  r  V  s     
P P"H HF FB B B B
 
"W W
 

 
@ @B B2	N 	NI I2B B2R R.I I0#I #IJ#: #:r0   r  c                   l   a  ] tR tRt o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R	 lR
 ltRt	V t
R# )TagLoaderTestsi  z
Tests for L{TagLoader}.
c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   TagLoaderTests.__annotate__  s     0 0t 0r0   c                N    \        \        P                  ! R 4      4      V n        R# )testN)r   r   rD  r   rL   s   &r-   setUpTagLoaderTests.setUp  s    v/r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r    s     D D Dr0   c                X    V P                  \        \        V P                  4      4       R# )z:
An instance of L{TagLoader} provides L{ITemplateLoader}.
N)
assertTruer   r   r   rL   s   &r-   test_interfaceTagLoaderTests.test_interface  s     	_dkkBCr0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r    s     8 8 8r0   c                b    V P                  V P                  P                  4       \        4       R# )z;
L{TagLoader.load} returns a list, per L{ITemplateLoader}.
N)assertIsInstancer   r   listrL   s   &r-   test_loadsListTagLoaderTests.test_loadsList  s!     	dkk..0$7r0   c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   r    s     : :d :r0   c                T    \        V P                  4      pV P                  VR4       R# )zv
L{TagLoader} can be used in an L{Element}, and flattens as the tag used
to construct the L{TagLoader} would flatten.
s   <i>test</i>N)r   r   r$  )r6   es   & r-   test_flattenTagLoaderTests.test_flatten  s"    
 DKK &&q.9r0   r!  N)rT   rU   rV   rW   rX   r  r  r  r  rY   rZ   r[   s   @r-   r  r    s4     0 0D D8 8: :r0   r  c                   *    ] tR tRtRt]! R4      tRtR# )TestElementi  z2
An L{Element} that can be rendered successfully.
zS<p xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1">Hello, world.</p>r*   N)rT   rU   rV   rW   rX   r   r   rY   r*   r0   r-   r  r    s     	Fr0   r  c                   J   a  ] tR tRt o Rt]! R4      tRV 3R lR lltRtV t	R# )	TestFailureElementi  z|
An L{Element} that can be used in place of L{FailureElement} to verify
that L{renderElement} can render failures properly.
zO<p xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1">I failed.</p>Nc                *   < V ^8  d   QhRS[ RS[RR/# )r(   failurer   r)   N)r   object)r+   r,   s   "r-   r.   TestFailureElement.__annotate__  s"        4 r0   c                    Wn         R # r   r  )r6   r  r   s   &&&r-   __init__TestFailureElement.__init__  s    r0   r  r   )
rT   rU   rV   rW   rX   r   r   r  rY   rZ   r[   s   @r-   r  r    s*     
 	F  r0   r  c                   6   a  ] tR tRt o RtV 3R lR ltRtV tR# )FailingElementi  z4
An element that raises an exception when rendered.
c                4   < V ^8  d   QhRS[ S[,          RR/# )r(   r   r)   r   )r   r   )r+   r,   s   "r-   r.   FailingElement.__annotate__  s       hx0 ] r0   c                    ^*p^ pW#,           # )*   r*   )r6   r   r2   bs   &&  r-   ra   FailingElement.render  s    &r0   r*   N)rT   rU   rV   rW   rX   ra   rY   rZ   r[   s   @r-   r  r    s      r0   r  c                       ] tR tRtRtRtRtR# )FakeSitei  zD
A minimal L{Site} object that we can use to test displayTracebacks
Fr*   N)rT   rU   rV   rW   rX   displayTracebacksrY   r*   r0   r-   r  r    s     r0   r  c                   B   a a ] tR tRt oRtV3R lV 3R lltRtVtV ;t# )DummyRenderRequesti  z
A dummy request object that has a C{site} attribute.

This does not implement the full IRequest interface, but enough of it
for this test suite.
c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   DummyRenderRequest.__annotate__  s      $ r0   c                F   < \         SV `  R .4       \        4       V n        R# )r0   N)superr  r  site)r6   	__class__s   &r-   r  DummyRenderRequest.__init__  s    #J	r0   )r  )	rT   rU   rV   rW   rX   r  rY   rZ   __classcell__)r  r,   s   @@r-   r  r    s       r0   r  c                      a  ] tR tRt o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R	 lR
 ltV 3R lR lt	V 3R lR lt
RtV tR# )RenderElementTestsi  z
Test L{renderElement}
c                   < V ^8  d   QhRR/# r'   r*   )r+   r,   s   "r-   r.   RenderElementTests.__annotate__  s     , ,t ,r0   c                $    \        4       V n        R# )z(
Set up a common L{DummyRenderRequest}.
N)r  r   rL   s   &r-   r  RenderElementTests.setUp  s     *+r0   c                .   < V ^8  d   QhRS[ R,          /# r'   r   )r+   r,   s   "r-   r.   r    s      8D> r0   c                   a  \        4       pS P                  P                  4       pR V 3R llpVP                  V4       S P	                  \
        \        S P                  V4      4       V# )z
L{renderElement} returns NOT_DONE_YET and eventually
writes the rendered L{Element} to the request before finishing the
request.
c                (    V ^8  d   QhR\         RR/# r(   _r)   Nr  )r+   s   "r-   r.   :RenderElementTests.test_simpleRender.<locals>.__annotate__  s     	3 	3V 	3 	3r0   c                    < SP                  R P                  SP                  P                  4      R4       SP	                  SP                  P
                  4       R# )r0   s$   <!DOCTYPE html>
<p>Hello, world.</p>N)r3   joinr   writtenr  finishedr  r6   s   &r-   check3RenderElementTests.test_simpleRender.<locals>.check  sB    --.< OODLL112r0   )r  r   notifyFinishaddCallbackrb   r   r   r6   rc   dr  s   f   r-   test_simpleRender$RenderElementTests.test_simpleRender  sV     -LL%%'	3 	3 	
e\=w+OPr0   c                .   < V ^8  d   QhRS[ R,          /# r'   r  )r+   r,   s   "r-   r.   r  (  s      HTN r0   c                   a  \        4       pS P                  P                  4       pR V 3R llpVP                  V4       S P	                  \
        \        S P                  V4      4       V# )zg
L{renderElement} handles failures by writing a minimal
error message to the request and finishing it.
c                (    V ^8  d   QhR\         RR/# r
  r  )r+   s   "r-   r.   ;RenderElementTests.test_simpleFailure.<locals>.__annotate__1  s     	3 	3V 	3 	3r0   c                   < SP                  \        4      pSP                  \        V4      ^4       SP                  RP	                  SP
                  P                  4      R4       SP                  SP
                  P                  4       R# )r  r0   s   <!DOCTYPE html>
<div style="font-size:800%;background-color:#FFF;color:#F00">An error occurred while rendering the response.</div>N)	flushLoggedErrorsr   r3   r   r  r   r  r  r  )r  flushedr6   s   & r-   r  4RenderElementTests.test_simpleFailure.<locals>.check1  si    ,,^<GS\1---.O	 OODLL112r0   )r  r   r  r  rb   r   r   r  s   f   r-   test_simpleFailure%RenderElementTests.test_simpleFailure(  sW    
 !"LL%%'	3 	3 	
e\=w+OPr0   c                .   < V ^8  d   QhRS[ R,          /# r'   r  )r+   r,   s   "r-   r.   r  F  s      $ r0   c                ,  a a \         P                  ! S \        4      oRS P                  P                  n        \        4       pS P                  P                  4       pR VV 3R llpVP                  V4       \        S P                  V\        R7       V# )z
L{renderElement} will render a traceback when rendering of
the element fails and our site is configured to display tracebacks.
Tc                (    V ^8  d   QhR\         RR/# r
  r  )r+   s   "r-   r.   HRenderElementTests.test_simpleFailureWithTraceback.<locals>.__annotate__R  s     		3 		3V 		3 		3r0   c                   < SP                  ^\        S4      4       S^ ,          R,          pSP                  VP                  \        4       SP                  \        4      pSP                  \        V4      ^4       SP                  RP                  SP                  P                  4      R4       SP                  SP                  P                  4       R# )r  log_failurer0   s    <!DOCTYPE html>
<p>I failed.</p>N)assertEqualsr   r  valuer   r   r3   r  r   r  r  r  )r  fr!  logObserverr6   s   &  r-   r  ARenderElementTests.test_simpleFailureWithTraceback.<locals>.checkR  s    a[!12A}-A!!!''>:,,^<GS\1---.0T OODLL112r0   )_failElement)r	   createWithCleanupr
   r   r  r  r  r  r  r   r  )r6   rc   r  r  r.  s   f   @r-   test_simpleFailureWithTraceback2RenderElementTests.test_simpleFailureWithTracebackF  sr    
 +<<TCUV.2+ "LL%%'		3 		3 	
edllG:LMr0   c                .   < V ^8  d   QhRS[ R,          /# r'   r  )r+   r,   s   "r-   r.   r  c  s       r0   c                   a  \        4       pS P                  P                  4       pR V 3R llpVP                  V4       \	        S P                  VRR7       V# )z[
L{renderElement} will write the doctype string specified by the
doctype keyword argument.
c                (    V ^8  d   QhR\         RR/# r
  r  )r+   s   "r-   r.   ?RenderElementTests.test_nonDefaultDoctype.<locals>.__annotate__l  s     	 	V 	 	r0   c                 r   < SP                  R P                  SP                  P                  4      R4       R# )r0   s   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<p>Hello, world.</p>Nr3   r  r   r  r  s   &r-   r  8RenderElementTests.test_nonDefaultDoctype.<locals>.checkl  s,    --.,r0   sm   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">doctyper  r   r  r  r   r  s   f   r-   test_nonDefaultDoctype)RenderElementTests.test_nonDefaultDoctypec  sU    
 -LL%%'	 	 	
eLLI		
 r0   c                .   < V ^8  d   QhRS[ R,          /# r'   r  )r+   r,   s   "r-   r.   r    s      (4. r0   c                   a  \        4       pS P                  P                  4       pR V 3R llpVP                  V4       \	        S P                  VRR7       V# )z[
L{renderElement} will not write out a doctype if the doctype keyword
argument is L{None}.
c                (    V ^8  d   QhR\         RR/# r
  r  )r+   s   "r-   r.   9RenderElementTests.test_noneDoctype.<locals>.__annotate__  s     	V 	VV 	V 	Vr0   c                 r   < SP                  R P                  SP                  P                  4      R4       R# )r0   r"  Nr9  r  s   &r-   r  2RenderElementTests.test_noneDoctype.<locals>.check  s'    SXXdll&:&:;=TUr0   Nr;  r=  r  s   f   r-   test_noneDoctype#RenderElementTests.test_noneDoctype  sM    
 -LL%%'	V 	V 	
edllGT:r0   )r   N)rT   rU   rV   rW   rX   r  r  r#  r2  r>  rF  rY   rZ   r[   s   @r-   r  r    sG     , , . < : @ r0   r  )FrX   r   ior   typingr   r   zope.interfacer   zope.interface.verifyr   twisted.internet.deferr   r   twisted.internet.testingr	   twisted.loggerr
   twisted.python.failurer   twisted.python.filepathr   twisted.trial.unittestr   twisted.trial.utilr   SUPPRESStwisted.web._elementr   twisted.web.errorr   r   r   twisted.web.iwebr   r   twisted.web.serverr   twisted.web.templater   r   r   r   r   r   r   r   r   twisted.web.test._utilr   twisted.web.test.test_webr    r   r   r%   r]   r   r   r   r  r  r  r  r  r  r  r  r  r  r  r*   r0   r-   <module>r[     sS     ! & . 4 9 - * , + 3 5 X X 6 +
 
 
 3 2? )@h )@XeT8 eTP,x ,>21 21j.8%8 .x)< "68%8 6 x)<  "S:o S:l
:_ ::	' 	  W   X
 
 
M Mr0   