ó
    ×›‘h†q  ã                   ó¤  • S r SSKrSSKJr  SSKJrJr  SSKJr  SSK	J
r
  SSKJrJr  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJrJrJ r   SSK!J"r"J#r#  SSK$J%r%  SSK&J'r'J(r(J)r)J*r*J+r+J,r,J-r-J.r.J/r/  SSK0J1r1  SSK2J3r3  \" \4SS9r5 " S S\5      r6 " S S\5      r7 " S S\5      r8 " S S5      r9 " S S \\95      r: " S! S"\\95      r; " S# S$\\95      r< " S% S&\\95      r= " S' S(\15      r> " S) S*\15      r? " S+ S,\'5      r@ " S- S.\'5      rA " S/ S0\'5      rB " S1 S25      rC\" \"5       " S3 S4\35      5       rD " S5 S6\5      rEg)7z#
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)ÚDummyRequestúhPassing filenames or file objects to XMLFile is deprecated since Twisted 12.1.  Pass a FilePath instead.)ÚcategoryÚmessagec                   óJ   • \ rS rSrSrS
S jrS
S jrS
S jrS
S jrS
S jr	S	r
g)ÚTagFactoryTestsé/   zG
Tests for L{_TagFactory} through the publicly-exposed L{tags} object.
Nc                 ó\   • [         R                  nU R                  UR                  S5        g)z-
HTML tags can be retrieved through C{tags}.
ÚaN)r   r)   ÚassertEqualÚtagName©ÚselfÚtags     ÚbC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/web/test/test_template.pyÚtest_lookupTagÚTagFactoryTests.test_lookupTag4   s!   € ô �f‰fˆØ×Ñ˜Ÿ™ cÕ*ó    c                 ó\   • [         R                  nU R                  UR                  S5        g)zR
Twisted supports the latest and greatest HTML tags from the HTML5
specification.
ÚvideoN)r   r4   r*   r+   r,   s     r/   Útest_lookupHTML5TagÚ#TagFactoryTests.test_lookupHTML5Tag;   s!   € ô
 �j‰jˆØ×Ñ˜Ÿ™ gÕ.r2   c                 ó\   • [         R                  nU R                  UR                  S5        g)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   Útransparentr*   r+   r,   s     r/   Útest_lookupTransparentTagÚ)TagFactoryTests.test_lookupTransparentTagC   s#   € ô ×ÑˆØ×Ñ˜Ÿ™ bÕ)r2   c                 óD   • U R                  [        [        [        S5        g)z^
Invalid tags which are not part of HTML cause AttributeErrors when
accessed through C{tags}.
ÚinvalidN©ÚassertRaisesÚAttributeErrorÚgetattrr   ©r-   s    r/   Útest_lookupInvalidTagÚ%TagFactoryTests.test_lookupInvalidTagL   s   € ð
 	×Ñœ.¬'´4¸ÕCr2   c                 óD   • U R                  [        [        [        S5        g)zy
As a special case, the <xmp> tag is simply not available through
C{tags} or any other part of the templating machinery.
ÚxmpNr>   rB   s    r/   Útest_lookupXMPÚTagFactoryTests.test_lookupXMPS   s   € ð
 	×Ñœ.¬'´4¸Õ?r2   © ©ÚreturnN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r0   r5   r:   rC   rG   Ú__static_attributes__rI   r2   r/   r&   r&   /   s"   † ñô+ô/ô*ôD÷@r2   r&   c                   óh   • \ rS rSrSrSS jrSS jrSS jrSS jrSS jr	SS	 jr
SS
 jrSS jrSrg)ÚElementTestsé[   z-
Tests for the awesome new L{Element} class.
Nc                 ó’   • [        5       nU R                  [        UR                  S5      nU R	                  UR
                  U5        g)zZ
L{Element.render} raises L{MissingTemplateLoader} if the C{loader}
attribute is L{None}.
N)r   r?   r   ÚrenderÚassertIdenticalÚelement©r-   rX   Úerrs      r/   Útest_missingTemplateLoaderÚ'ElementTests.test_missingTemplateLoader`   s8   € ô
 “)ˆØ×ÑÔ 5°w·~±~ÀtÓLˆØ×Ñ˜SŸ[™[¨'Õ2r2   c           	      ót   •  " S S[         5      nU R                  S[        [        U" 5       5      5      5        g)zD
A L{MissingTemplateLoader} instance can be repr()'d without error.
c                   ó"   • \ rS rSrS\4S jrSrg)ÚFElementTests.test_missingTemplateLoaderRepr.<locals>.PrettyReprElementén   rK   c                 ó   • g©NúPretty Repr ElementrI   rB   s    r/   Ú__repr__ÚOElementTests.test_missingTemplateLoaderRepr.<locals>.PrettyReprElement.__repr__o   ó   € Ø,r2   rI   N©rL   rM   rN   rO   Ústrrd   rQ   rI   r2   r/   ÚPrettyReprElementr_   n   ó   † ð- #÷ -r2   ri   rc   N)r   ÚassertInÚreprr   )r-   ri   s     r/   Útest_missingTemplateLoaderReprÚ+ElementTests.test_missingTemplateLoaderRepri   s0   € ô
	-¤ô 	-ð 	�‰Ø!¤4Ô(=Ñ>OÓ>QÓ(RÓ#Sõ	
r2   c                 óÊ   • [        5       nU R                  [        UR                  S5      nU R	                  UR
                  U5        U R                  UR                  S5        g)z†
When called with the name which is not associated with a render method,
L{Element.lookupRenderMethod} raises L{MissingRenderMethod}.
ÚfooN)r   r?   r   ÚlookupRenderMethodrW   rX   r*   Ú
renderNamerY   s      r/   Útest_missingRendererMethodÚ'ElementTests.test_missingRendererMethodv   sO   € ô
 “)ˆØ×ÑÔ 3°W×5OÑ5OÐQVÓWˆØ×Ñ˜SŸ[™[¨'Ô2Ø×Ñ˜Ÿ™¨Õ/r2   c                 óž   •  " S S[         5      n[        [        U" 5       S5      5      nU R                  SU5        U R                  SU5        g)zB
A L{MissingRenderMethod} instance can be repr()'d without error.
c                   ó"   • \ rS rSrS\4S jrSrg)ÚDElementTests.test_missingRenderMethodRepr.<locals>.PrettyReprElementé…   rK   c                 ó   • grb   rI   rB   s    r/   rd   ÚMElementTests.test_missingRenderMethodRepr.<locals>.PrettyReprElement.__repr__†   rf   r2   rI   Nrg   rI   r2   r/   ri   rw   …   rj   r2   ri   ÚexpectedMethodrc   N)r   rl   r   rk   )r-   ri   Úss      r/   Útest_missingRenderMethodReprÚ)ElementTests.test_missingRenderMethodRepr€   sE   € ô
	-¤ô 	-ô Ô$Ñ%6Ó%8Ð:JÓKÓLˆØ�‰Ð+¨QÔ/Ø�‰Ð&¨Õ*r2   c                 óœ   •  " S S[         5      nU" 5       R                  S5      nU R                  U" S[        R                  5      S5        g)zq
When called with the name of a defined render method,
L{Element.lookupRenderMethod} returns that render method.
c                   ó:   • \ rS rSr\S\\   S\S\4S j5       r	Sr
g)ÚBElementTests.test_definedRenderer.<locals>.ElementWithRenderMethodé“   Úrequestr.   rK   c                 ó   • g)NÚbarrI   ©r-   rƒ   r.   s      r/   rp   ÚFElementTests.test_definedRenderer.<locals>.ElementWithRenderMethod.foo”   s   € àr2   rI   N)rL   rM   rN   rO   r   r   r   r   r   rp   rQ   rI   r2   r/   ÚElementWithRenderMethodr�   “   s.   † Øð 8¨HÑ#5ð ¸Cð ÀKó ó ór2   rˆ   rp   Nr…   )r   rq   r*   r   Úbr)r-   rˆ   rp   s      r/   Útest_definedRendererÚ!ElementTests.test_definedRenderer�   s>   € ô	¤gô 	ñ
 &Ó'×:Ñ:¸5ÓAˆØ×Ñ™˜T¤4§7¡7Ó+¨UÕ3r2   c                 ó´   ^• [        [        5       " S S5      5       m " U4S jS[        5      nU" 5       nU R                  UR	                  S5      S/5        g)zQ
L{Element.render} loads a document from the C{loader} attribute and
returns it.
c                   ó(   • \ rS rSrS\\   4S jrSrg)Ú0ElementTests.test_render.<locals>.TemplateLoaderé¡   rK   c                 ó   • S/$ )NÚresultrI   rB   s    r/   ÚloadÚ5ElementTests.test_render.<locals>.TemplateLoader.load£   s
   € Ø �zÐ!r2   rI   N)rL   rM   rN   rO   r   r   r’   rQ   rI   r2   r/   ÚTemplateLoaderrŽ   ¡   s   † ð"˜d ;Ñ/÷ "r2   r”   c                   ó&   >• \ rS rSr Y " 5       rSrg)Ú-ElementTests.test_render.<locals>.StubElementé¦   rI   N)rL   rM   rN   rO   ÚloaderrQ   )r”   s   €r/   ÚStubElementr–   ¦   s   ø† Ú#Ó%‹Fr2   r™   Nr‘   )r   r   r   r*   rV   )r-   r™   rX   r”   s      @r/   Útest_renderÚElementTests.test_render›   sQ   ø€ ô 
”_Ó	%÷	"ð 	"ó 
&ð	"÷	&œ'ô 	&ñ “-ˆØ×Ñ˜Ÿ™¨Ó-°¨zÕ:r2   c                 óÎ   • U R                  [        [        5      n[        R                  S:¼  a  U R                  [        U5      S5        gU R                  [        U5      S5        g)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)r?   Ú	TypeErrorr   ÚsysÚversion_infor*   rh   )r-   Útes     r/   Útest_misuseRendererÚ ElementTests.test_misuseRenderer¬   sV   € ð
 ×Ñœy¬(Ó3ˆÜ×Ñ˜wÓ&Ø×ÑÜ�B“ÐXõð ×ÑÜ�B“ÐQõr2   c                 óP   • U R                  [        [        R                  SS5        g)zt
Called directly, without a default, L{renderer.get} raises
L{UnexposedMethodError} when it cannot find a renderer.
NÚnotARenderer)r?   r   r   ÚgetrB   s    r/   Útest_renderGetDirectlyErrorÚ(ElementTests.test_renderGetDirectlyError»   s   € ð
 	×ÑÔ.´·±¸dÀNÕSr2   rI   rJ   )rL   rM   rN   rO   rP   r[   rm   rs   r}   rŠ   rš   r£   r¨   rQ   rI   r2   r/   rS   rS   [   s0   † ñô3ô
ô0ô+ô4ô;ô"÷Tr2   rS   c                   óV   • \ rS rSrSrSS jrSS jr\/\l        SS jr	\/\	l        Sr
g)	ÚXMLFileReprTestséÃ   z:
Tests for L{twisted.web.template.XMLFile}'s C{__repr__}.
Nc                 ól   • [        S5      nU R                  SU< S3[        [        U5      5      5        g)z;
An L{XMLFile} with a L{FilePath} returns a useful repr().
ú/tmp/fake.xmlú<XMLFile of Ú>N)r   r*   rl   r   )r-   Úpaths     r/   Útest_filePathÚXMLFileReprTests.test_filePathÈ   s0   € ô ˜Ó(ˆØ×Ñ˜<¨¡x¨qÐ1´4¼À»Ó3FÕGr2   c                 óZ   • SnU R                  SU< S3[        [        U5      5      5        g)z8
An L{XMLFile} with a filename returns a useful repr().
r®   r¯   r°   N)r*   rl   r   )r-   Úfnames     r/   Útest_filenameÚXMLFileReprTests.test_filenameÏ   s+   € ð  ˆØ×Ñ˜<¨¡y°Ð2´D¼À»Ó4HÕIr2   c                 ól   • [        S5      nU R                  SU< S3[        [        U5      5      5        g)z;
An L{XMLFile} with a file object returns a useful repr().
znot xmlr¯   r°   N)r   r*   rl   r   )r-   Úfobjs     r/   Ú	test_fileÚXMLFileReprTests.test_fileØ   s0   € ô ˜	Ó"ˆØ×Ñ˜<¨¡x¨qÐ1´4¼À»Ó3FÕGr2   rI   rJ   )rL   rM   rN   rO   rP   r²   r¶   Ú_xmlFileSuppressr   rº   rQ   rI   r2   r/   r«   r«   Ã   s3   † ñôHôJð /Ð/€MÔôHð +Ð+€I×r2   r«   c                   óZ   • \ rS rSr% \\S'    Sr S\4S jrS
S jr	S
S jr
\/\
l        S	rg)ÚXMLLoaderTestsMixinéâ   ÚdeprecatedUseú<p>Hello, world.</p>rK   c                 ó   • [         e©N)ÚNotImplementedErrorrB   s    r/   ÚloaderFactoryÚ!XMLLoaderTestsMixin.loaderFactoryî   s   € Ü!Ð!r2   Nc                 óB  • [        U [        5      (       d   eU R                  5       nUR                  5       u  n[        U[        5      (       d   eU R                  U R                  /S9nU R                  (       aP  U R                  [        U5      S5        U R                  US   S   [        5        U R                  US   S   S5        OU R                  [        U5      S5        U R                  UR                  S5        U R                  UR                  S/5        g	)
zA
Verify that the loader returns a tag with the correct children.
)ÚoffendingFunctionsé   r   r#   r$   r"   ÚpúHello, world.N)Ú
isinstancer   rÅ   r’   r   ÚflushWarningsrÀ   r*   ÚlenÚDeprecationWarningr+   Úchildren)r-   r˜   r.   Úwarningss       r/   Ú	test_loadÚXMLLoaderTestsMixin.test_loadñ   sù   € ô ˜$¤×)Ñ)Ð)Ð)Ø×#Ñ#Ó%ˆØ—‘“‰ˆÜ˜#œs×#Ñ#Ð#Ð#à×%Ñ%¸$×:LÑ:LÐ9MÐ%ÐNˆØ××Ø×ÑœS ›]¨AÔ.Ø×Ñ˜X a™[¨Ñ4Ô6HÔIØ×ÑØ˜‘˜IÑ&ðKõð ×ÑœS ›]¨AÔ.à×Ñ˜Ÿ™ cÔ*Ø×Ñ˜Ÿ™¨Ð'8Õ9r2   c                 ó´   • [        U [        5      (       d   eU R                  5       nUR                  5       nUR                  5       nU R	                  X#5        g)zL
If {load()} can be called on a loader twice the result should be the
same.
N)rÌ   r   rÅ   r’   r*   )r-   r˜   Útags1Útags2s       r/   Útest_loadTwiceÚ"XMLLoaderTestsMixin.test_loadTwice	  sI   € ô
 ˜$¤×)Ñ)Ð)Ð)Ø×#Ñ#Ó%ˆØ—‘“ˆØ—‘“ˆØ×Ñ˜Õ&r2   rI   rJ   )rL   rM   rN   rO   ÚboolÚ__annotations__ÚtemplateStringr   rÅ   rÒ   r×   r¼   r   rQ   rI   r2   r/   r¾   r¾   â   s<   ‡ ØÓðð
 ,€Nðð"˜ô "ô:ô0	'ð  0Ð0€N×r2   r¾   c                   ó*   • \ rS rSrSrSrS\4S jrSrg)ÚXMLStringLoaderTestsi  z-
Tests for L{twisted.web.template.XMLString}
FrK   c                 ó,   • [        U R                  5      $ )zC
@return: an L{XMLString} constructed with C{self.templateString}.
)r   rÛ   rB   s    r/   rÅ   Ú"XMLStringLoaderTests.loaderFactory  s   € ô ˜×,Ñ,Ó-Ð-r2   rI   N©	rL   rM   rN   rO   rP   rÀ   r   rÅ   rQ   rI   r2   r/   rÝ   rÝ     s   † ñð €Mð.˜÷ .r2   rÝ   c                   ó*   • \ rS rSrSrSrS\4S jrSrg)ÚXMLFileWithFilePathTestsi%  zB
Tests for L{twisted.web.template.XMLFile}'s L{FilePath} support.
FrK   c                 óž   • [        U R                  5       5      nUR                  U R                  R	                  S5      5        [        U5      $ )zv
@return: an L{XMLString} constructed with a L{FilePath} pointing to a
    file that contains C{self.templateString}.
Úutf8)r   ÚmktempÚ
setContentrÛ   Úencoder   ©r-   Úfps     r/   rÅ   Ú&XMLFileWithFilePathTests.loaderFactory,  s;   € ô
 �d—k‘k“mÓ$ˆØ
�‰�d×)Ñ)×0Ñ0°Ó8Ô9Ü�r‹{Ðr2   rI   Nrà   rI   r2   r/   râ   râ   %  s   † ñð €Mð˜÷ r2   râ   c                   ó*   • \ rS rSrSrSrS\4S jrSrg)ÚXMLFileWithFileTestsi6  zM
Tests for L{twisted.web.template.XMLFile}'s deprecated file object support.
TrK   c                 ó>   • [        [        U R                  5      5      $ )zc
@return: an L{XMLString} constructed with a file object that contains
    C{self.templateString}.
)r   r   rÛ   rB   s    r/   rÅ   Ú"XMLFileWithFileTests.loaderFactory=  s   € ô
 ”x × 3Ñ 3Ó4Ó5Ð5r2   rI   Nrà   rI   r2   r/   rì   rì   6  s   † ñð €Mð6˜÷ 6r2   rì   c                   ó*   • \ rS rSrSrSrS\4S jrSrg)ÚXMLFileWithFilenameTestsiE  zJ
Tests for L{twisted.web.template.XMLFile}'s deprecated filename support.
TrK   c                 ó²   • [        U R                  5       5      nUR                  U R                  R	                  S5      5        [        UR                  5      $ )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@   € ô
 �d—k‘k“mÓ$ˆØ
�‰�d×)Ñ)×0Ñ0°Ó8Ô9Ü�r—w‘wÓÐr2   rI   Nrà   rI   r2   r/   rð   rð   E  s   † ñð €Mð ˜÷  r2   rð   c                   óÌ   • \ rS rSrSrSS jrSS jrSS jrSS jrSS jr	SS	 jr
SS
 jrSS jrSS jrSS jrSS jrSS jrSS jrSS jrSS jrSS jrSS jrSS jrSrg)ÚFlattenIntegrationTestsiV  zO
Tests for integration between L{Element} and
L{twisted.web._flatten.flatten}.
Nc                 ób   • / SQnU H%  nU R                  [        [        U5      S9U5        M'     g)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.
)ó   <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>©r˜   N)ÚassertFlattensImmediatelyr   r   )r-   Ú	fragmentsÚxmls      r/   Útest_roundTripÚ&FlattenIntegrationTests.test_roundTrip\  s.   € ò
ˆ	ó ˆCØ×*Ñ*¬7¼)ÀC».Ñ+IÈ3ÖOò r2   c                 óL   • [        [        S5      S9nU R                  US5        g)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ù   ©r-   rX   s     r/   Útest_entityConversionÚ-FlattenIntegrationTests.test_entityConversionm  s%   € ô
 ¤Ð+;Ó!<Ñ=ˆØ×&Ñ& wÐ0FÕGr2   c                 ó@   • U R                  [        5       [        5        g)zS
Rendering an Element without a loader attribute raises the appropriate
exception.
N)ÚassertFlatteningRaisesr   r   rB   s    r/   r[   Ú2FlattenIntegrationTests.test_missingTemplateLoaderu  s   € ð
 	×#Ñ#¤G£IÔ/DÕEr2   c                 óT   • [        [        S5      S9nU R                  U[        5        g)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   r  r   r   s     r/   Útest_missingRenderMethodÚ0FlattenIntegrationTests.test_missingRenderMethod|  s.   € ô Üðóñ
ˆð 	×#Ñ# GÔ-@ÕAr2   c                 óL   • [        [        S5      S9nU R                  US5        g)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_transparentRenderingÚ1FlattenIntegrationTests.test_transparentRenderingŒ  s.   € ô
 Üð#óñ
ˆð 	×&Ñ& wÐ0@ÕAr2   c                 óL   • [        [        S5      S9nU R                  US5        g)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õ	
r2   c                 óx   • U R                  [        S5       Vs/ s H  n[        S5      PM     snS5        gs  snf )z~
When rendering a large number of already-fired Deferreds we should not
encounter any recursion errors or stack-depth issues.
éú   Úxsú   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxN)rù   Úranger	   )r-   Úis     r/   Ú!test_synchronousDeferredRecursionÚ9FlattenIntegrationTests.test_synchronousDeferredRecursion¬  s.   € ð
 	×&Ñ&¼eÀC¼jÓ'Iºj¸¬°®¹jÑ'IÈ:ÕVùÒ'Is   ™7c                 ó:   • U R                  [        [        S5        g)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©r?   ÚAssertionErrorr   rB   s    r/   Útest_errorToplevelAttrÚ.FlattenIntegrationTests.test_errorToplevelAttr³  s   € ð
 	×ÑÜÜðõ	
r2   c                 ó:   • U R                  [        [        S5        g)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>Nr  rB   s    r/   Útest_errorUnnamedAttrÚ-FlattenIntegrationTests.test_errorUnnamedAttrÂ  s   € ð
 	×ÑÜÜð&õ	
r2   c                 ól   • Sn[        [        U5      S9nU R                  X!R                  S5      5        g)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ç   )r-   ÚtheInputrX   s      r/   Útest_lenientPrefixBehaviorÚ2FlattenIntegrationTests.test_lenientPrefixBehaviorÏ  s4   € ð3ð 	ô
 ¤¨8Ó!4Ñ5ˆØ×Ñ˜g§¡°vÓ'>Õ?r2   c                 ód   •  " S S[         5      nU" [        S5      S9nU R                  US5        g)zQ
An Element with a render method which returns a Deferred will render
correctly.
c                   ó:   • \ rS rSr\S\\   S\S\4S j5       r	Sr
g)ÚHFlattenIntegrationTests.test_deferredRendering.<locals>.RenderfulElementiâ  rƒ   r.   rK   c                 ó   • [        S5      $ ©NrË   )r	   r†   s      r/   ÚrenderMethodÚUFlattenIntegrationTests.test_deferredRendering.<locals>.RenderfulElement.renderMethodã  s   € ô ˜Ó/Ð/r2   rI   N©rL   rM   rN   rO   r   r   r   r   r   r)  rQ   rI   r2   r/   ÚRenderfulElementr&  â  s1   † Øð0Ø'¨Ñ1ð0Ø8;ð0àó0ó ó0r2   r,  úŸ
        <p xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1"
          t:render="renderMethod">
            Goodbye, world.
        </p>
        rø   r
  Nrÿ   ©r-   r,  rX   s      r/   Útest_deferredRenderingÚ.FlattenIntegrationTests.test_deferredRenderingÜ  s:   € ô	0œwô 	0ñ #Üðóñ	
ˆð 	×&Ñ& wÐ0@ÕAr2   c                 óP   •  " S S[         5      nU R                  U" 5       S5        g)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                   ó$   • \ rS rSr\" S5      rSrg)ÚEFlattenIntegrationTests.test_loaderClassAttribute.<locals>.SubElementiû  rÁ   rI   N)rL   rM   rN   rO   r   r˜   rQ   rI   r2   r/   Ú
SubElementr3  û  s   † ÙÐ5Ó6‹Fr2   r4  rö   N)r   rù   )r-   r4  s     r/   Útest_loaderClassAttributeÚ1FlattenIntegrationTests.test_loaderClassAttributeõ  s#   € ô	7œô 	7ð 	×&Ñ&¡z£|Ð5LÕMr2   c                 óp   ^• / m " U4S jS[         5      nU" [        S5      S9nU R                  US5        g)zi
An Element with a valid render directive has that directive invoked and
the result added to the output.
c                   óB   >• \ rS rSr\S\\   S\S\4U 4S jj5       r	Sr
g)ÚIFlattenIntegrationTests.test_directiveRendering.<locals>.RenderfulElementi  rƒ   r.   rK   c                 ó8   >• TR                  X45        U" S5      $ r(  )Úappend)r-   rƒ   r.   Úrenderss      €r/   r)  ÚVFlattenIntegrationTests.test_directiveRendering.<locals>.RenderfulElement.renderMethod  s   ø€ ð —‘ ˜Ô/Ù˜?Ó+Ð+r2   rI   Nr+  )r<  s   €r/   r,  r9    s2   ø† Øð,Ø'¨Ñ1ð,Ø8;ð,àö,ó ó,r2   r,  úx
        <p xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1"
          t:render="renderMethod" />
        rø   rö   Nrÿ   )r-   r,  rX   r<  s      @r/   Útest_directiveRenderingÚ/FlattenIntegrationTests.test_directiveRendering   sB   ø€ ð
 ˆ÷	,œwô 	,ñ #Üðóñ
ˆð 	×&Ñ& wÐ0GÕHr2   c                 ód   •  " S S[         5      nU" [        S5      S9nU R                  US5        g)zo
An Element with a render method which omits the containing tag
successfully removes that tag from the output.
c                   ó:   • \ rS rSr\S\\   S\S\4S j5       r	Sr
g)ÚTFlattenIntegrationTests.test_directiveRenderingOmittingTag.<locals>.RenderfulElementi  rƒ   r.   rK   c                 ó   • gr(  rI   r†   s      r/   r)  ÚaFlattenIntegrationTests.test_directiveRenderingOmittingTag.<locals>.RenderfulElement.renderMethod   s   € ð 'r2   rI   Nr+  rI   r2   r/   r,  rC    s1   † Øð'Ø'¨Ñ1ð'Ø8;ð'àó'ó ó'r2   r,  r-  rø   r
  Nrÿ   r.  s      r/   Ú"test_directiveRenderingOmittingTagÚ:FlattenIntegrationTests.test_directiveRenderingOmittingTag  s:   € ô	'œwô 	'ñ #Üðóñ	
ˆð 	×&Ñ& wÐ0@ÕAr2   c                 ód   •  " S S[         5      nU" [        S5      S9nU R                  US5        g)ú\
An Element which is returned by the render method of another Element is
rendered properly.
c                   ó:   • \ rS rSr\S\\   S\S\4S j5       r	Sr
g)ÚUFlattenIntegrationTests.test_elementContainingStaticElement.<locals>.RenderfulElementi8  rƒ   r.   rK   c                 ó2   • U" [        [        S5      S95      $ )Nz<em>Hello, world.</em>rø   )r   r   r†   s      r/   r)  ÚbFlattenIntegrationTests.test_elementContainingStaticElement.<locals>.RenderfulElement.renderMethod9  s   € ñ œ7¬)Ð4LÓ*MÑNÓOÐOr2   rI   Nr+  rI   r2   r/   r,  rK  8  s6   † ØðPØ'¨Ñ1ðPØ8;ðPàóPó óPr2   r,  r>  rø   s   <p><em>Hello, world.</em></p>Nrÿ   r.  s      r/   Ú#test_elementContainingStaticElementÚ;FlattenIntegrationTests.test_elementContainingStaticElement2  s<   € ô	Pœwô 	Pñ #Üðóñ
ˆð 	×&Ñ& wÐ0PÕQr2   c                 ód   •  " S S[         5      nU" [        S5      S9nU R                  US5        g)rI  c                   ó:   • \ rS rSr\S\\   S\S\4S j5       r	Sr
g)ÚHFlattenIntegrationTests.test_elementUsingSlots.<locals>.RenderfulElementiO  rƒ   r.   rK   c                 ó    • UR                  SS9$ )Nzworld.)Útest2)Ú	fillSlotsr†   s      r/   r)  ÚUFlattenIntegrationTests.test_elementUsingSlots.<locals>.RenderfulElement.renderMethodP  s   € ð —}‘}¨8�}Ð4Ð4r2   rI   Nr+  rI   r2   r/   r,  rR  O  s1   † Øð5Ø'¨Ñ1ð5Ø8;ð5àó5ó ó5r2   r,  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ÿ   r.  s      r/   Útest_elementUsingSlotsÚ.FlattenIntegrationTests.test_elementUsingSlotsI  s:   € ô	5œwô 	5ñ #Üðóñ
ˆð 	×&Ñ& wÐ0GÕHr2   c                 óŠ   ^•  " U4S jS[         5      n " S S[         5      mU" [        S5      S9nU R                  US5        g)	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                   óB   >• \ rS rSr\S\\   S\S\4U 4S jj5       r	Sr
g)ÚRFlattenIntegrationTests.test_elementContainingDynamicElement.<locals>.OuterElementih  rƒ   r.   rK   c                 ó.   >• U" T" [        S5      S95      $ )Nz©
                <t:ignored
                  xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1"
                  t:render="innerMethod" />
                rø   )r   )r-   rƒ   r.   ÚInnerElements      €r/   ÚouterMethodÚ^FlattenIntegrationTests.test_elementContainingDynamicElement.<locals>.OuterElement.outerMethodi  s%   ø€ áÙ Ü(ðó ñó
ð 
r2   rI   N)rL   rM   rN   rO   r   r   r   r   r   r^  rQ   )r]  s   €r/   ÚOuterElementr[  h  s/   ø† Øð¨8°HÑ+=ð ÀCð ÈKö ó ór2   r`  c                   ó:   • \ rS rSr\S\\   S\S\4S j5       r	Sr
g)ÚRFlattenIntegrationTests.test_elementContainingDynamicElement.<locals>.InnerElementiw  rƒ   r.   rK   c                 ó   • gr(  rI   r†   s      r/   ÚinnerMethodÚ^FlattenIntegrationTests.test_elementContainingDynamicElement.<locals>.InnerElement.innerMethodx  s   € à&r2   rI   N)rL   rM   rN   rO   r   r   r   r   r   rd  rQ   rI   r2   r/   r]  rb  w  s.   † Øð'¨8°HÑ+=ð 'ÀCð 'ÈKó 'ó ó'r2   r]  zw
        <p xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1"
          t:render="outerMethod" />
        rø   rö   Nrÿ   )r-   r`  rX   r]  s      @r/   Ú$test_elementContainingDynamicElementÚ<FlattenIntegrationTests.test_elementContainingDynamicElementa  sG   ø€ ÷	œ7ô 	ô	'œ7ô 	'ñ
 Üðóñ
ˆð 	×&Ñ& wÐ0GÕHr2   c                 óÌ   ^^• [        S5      m " UU4S jS[        5      mT" 5       nT" 5       nU R                  US5        U R                  US5        U R                  US5        g)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                   óv   >• \ rS rSrSrSr Yr\S\\	   S\
S\4U 4S jj5       r\S\\	   S\
S\4S j5       rSrg	)
ÚHFlattenIntegrationTests.test_sameLoaderTwice.<locals>.DestructiveElementi’  r   rƒ   r.   rK   c                 ód   >• T=R                   S-  sl         U" [        TR                   5      5      $ ©NrÉ   )Úcountrh   )r-   rƒ   r.   ÚDestructiveElements      €r/   ÚclassCounterÚUFlattenIntegrationTests.test_sameLoaderTwice.<locals>.DestructiveElement.classCounter—  s-   ø€ ð #×(Ò(¨AÑ-Õ(Ùœ3Ð1×7Ñ7Ó8Ó9Ð9r2   c                 ób   • U =R                   S-  sl         U" [        U R                   5      5      $ rl  )ÚinstanceCountrh   r†   s      r/   ÚinstanceCounterÚXFlattenIntegrationTests.test_sameLoaderTwice.<locals>.DestructiveElement.instanceCounterž  s+   € ð ×"Ò" aÑ'Õ"Ùœ3˜t×1Ñ1Ó2Ó3Ð3r2   rI   N)rL   rM   rN   rO   rm  rr  r˜   r   r   r   r   r   ro  rs  rQ   )rn  ÚsharedLoaders   €€r/   rn  rj  ’  sr   ø† ØˆEØˆMÙ!ˆFàð:Ø'¨Ñ1ð:Ø8;ð:àö:ó ð:ð ð4Ø'¨Ñ1ð4Ø8;ð4àó4ó ó4r2   rn  s
   <p>1 1</p>s
   <p>2 2</p>s
   <p>3 1</p>N)r   r   rù   )r-   Úe1Úe2rn  ru  s      @@r/   Útest_sameLoaderTwiceÚ,FlattenIntegrationTests.test_sameLoaderTwice†  sg   ù€ ô
 !ðó
ˆ÷	4ð 	4¤ô 	4ñ&  Ó!ˆÙÓ!ˆØ×&Ñ& r¨=Ô9Ø×&Ñ& r¨=Ô9Ø×&Ñ& r¨=Õ9r2   rI   rJ   )rL   rM   rN   rO   rP   rü   r  r[   r  r  r  r  r  r  r"  r/  r5  r?  rF  rN  rW  rf  rx  rQ   rI   r2   r/   rô   rô   V  sp   † ñô
Pô"HôFôBô Bô
ô"Wô
ô
ô@ôBô2	NôIô2Bô2Rô.Iô0#I÷J#:r2   rô   c                   ó@   • \ rS rSrSrS	S jrS	S jrS	S jrS	S jrSr	g)
ÚTagLoaderTestsi¬  z
Tests for L{TagLoader}.
Nc                 óL   • [        [        R                  " S5      5      U l        g )NÚtest)r   r   r  r˜   rB   s    r/   ÚsetUpÚTagLoaderTests.setUp±  s   € Ü¤§¢ v£Ó/ˆ�r2   c                 óV   • U R                  [        [        U R                  5      5        g)z:
An instance of L{TagLoader} provides L{ITemplateLoader}.
N)Ú
assertTruer   r   r˜   rB   s    r/   Útest_interfaceÚTagLoaderTests.test_interface´  s   € ð 	�‰œ¤_°d·k±kÓBÕCr2   c                 ó`   • U R                  U R                  R                  5       [        5        g)z;
L{TagLoader.load} returns a list, per L{ITemplateLoader}.
N)ÚassertIsInstancer˜   r’   ÚlistrB   s    r/   Útest_loadsListÚTagLoaderTests.test_loadsListº  s!   € ð 	×Ñ˜dŸk™k×.Ñ.Ó0´$Õ7r2   c                 óR   • [        U R                  5      nU R                  US5        g)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ù   )r-   Úes     r/   Útest_flattenÚTagLoaderTests.test_flattenÀ  s"   € ô
 �D—K‘KÓ ˆØ×&Ñ& q¨.Õ9r2   rø   rJ   )
rL   rM   rN   rO   rP   r~  r‚  r‡  r‹  rQ   rI   r2   r/   r{  r{  ¬  s   † ñô0ôDô8÷:r2   r{  c                   ó(   • \ rS rSrSr\" S5      rSrg)Ú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>rI   N)rL   rM   rN   rO   rP   r   r˜   rQ   rI   r2   r/   rŽ  rŽ  É  s   † ññ ð	óƒFr2   rŽ  c                   óB   • \ rS rSrSr\" S5      rS
S\S\SS4S jjr	S	r
g)Ú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>NÚfailurer˜   rK   c                 ó   • Xl         g rÃ   ©r‘  )r-   r‘  r˜   s      r/   Ú__init__ÚTestFailureElement.__init__á  s   € Ø�r2   r“  rÃ   )rL   rM   rN   rO   rP   r   r˜   r   Úobjectr”  rQ   rI   r2   r/   r�  r�  Õ  s7   † ññ
 ð	ó€Fñ ð °ð À4÷ ð r2   r�  c                   ó0   • \ rS rSrSrS\\   SS4S jrSrg)	ÚFailingElementiå  z4
An element that raises an exception when rendered.
rƒ   rK   r   c                 ó   • SnSnX#-   $ )Né*   r   rI   )r-   rƒ   r)   Úbs       r/   rV   ÚFailingElement.renderê  s   € ØˆØˆØ‘&�Ðr2   rI   N)	rL   rM   rN   rO   rP   r   r   rV   rQ   rI   r2   r/   r˜  r˜  å  s   † ñð˜h xÑ0ð °]÷ r2   r˜  c                   ó   • \ rS rSrSrSrSrg)ÚFakeSiteið  zD
A minimal L{Site} object that we can use to test displayTracebacks
FrI   N)rL   rM   rN   rO   rP   ÚdisplayTracebacksrQ   rI   r2   r/   rž  rž  ð  s   † ñð Ór2   rž  c                   ó0   ^ • \ rS rSrSrSU 4S jjrSrU =r$ )Ú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                 óD   >• [         TU ]  S/5        [        5       U l        g )Nr2   )Úsuperr”  rž  Úsite)r-   Ú	__class__s    €r/   r”  ÚDummyRenderRequest.__init__  s   ø€ Ü‰Ñ˜#˜ÔÜ“Jˆ�	r2   )r¤  rJ   )rL   rM   rN   rO   rP   r”  rQ   Ú__classcell__)r¥  s   @r/   r¡  r¡  ø  s   ø† ñ÷õ r2   r¡  c                   ó†   • \ rS rSrSrSS jrS\S   4S jrS\S   4S jrS\S   4S jr	S\S   4S	 jr
S\S   4S
 jrSrg)ÚRenderElementTestsi  z
Test L{renderElement}
rK   Nc                 ó"   • [        5       U l        g)z(
Set up a common L{DummyRenderRequest}.
N)r¡  rƒ   rB   s    r/   r~  ÚRenderElementTests.setUp  s   € ô *Ó+ˆ�r2   c                 óæ   ^ • [        5       nT R                  R                  5       nS[        SS4U 4S jjnUR	                  U5        T R                  [        [        T R                  U5      5        U$ )z‚
L{renderElement} returns NOT_DONE_YET and eventually
writes the rendered L{Element} to the request before finishing the
request.
Ú_rK   Nc                 óº   >• TR                  SR                  TR                  R                  5      S5        TR	                  TR                  R
                  5        g )Nr2   s$   <!DOCTYPE html>
<p>Hello, world.</p>)r*   Újoinrƒ   Úwrittenr�  Úfinished©r­  r-   s    €r/   ÚcheckÚ3RenderElementTests.test_simpleRender.<locals>.check  sB   ø€ Ø×ÑØ—‘˜Ÿ™×-Ñ-Ó.Ø<ôð �O‰O˜DŸL™L×1Ñ1Õ2r2   )rŽ  rƒ   ÚnotifyFinishr–  ÚaddCallbackrW   r   r   ©r-   rX   Údr³  s   `   r/   Útest_simpleRenderÚ$RenderElementTests.test_simpleRender  s_   ø€ ô “-ˆà�L‰L×%Ñ%Ó'ˆð	3”Vð 	3 ÷ 	3ð 	
�‰�eÔà×Ñœ\¬=¸¿¹ÀwÓ+OÔPàˆr2   c                 óæ   ^ • [        5       nT R                  R                  5       nS[        SS4U 4S jjnUR	                  U5        T R                  [        [        T R                  U5      5        U$ )zg
L{renderElement} handles failures by writing a minimal
error message to the request and finishing it.
r­  rK   Nc                 ó  >• TR                  [        5      nTR                  [        U5      S5        TR                  SR	                  TR
                  R                  5      S5        TR                  TR
                  R                  5        g )NrÉ   r2   s‚   <!DOCTYPE html>
<div style="font-size:800%;background-color:#FFF;color:#F00">An error occurred while rendering the response.</div>)	ÚflushLoggedErrorsr   r*   rÎ   r¯  rƒ   r°  r�  r±  )r­  Úflushedr-   s     €r/   r³  Ú4RenderElementTests.test_simpleFailure.<locals>.check1  si   ø€ Ø×,Ñ,¬^Ó<ˆGØ×ÑœS ›\¨1Ô-Ø×ÑØ—‘˜Ÿ™×-Ñ-Ó.ðOô	ð �O‰O˜DŸL™L×1Ñ1Õ2r2   )r˜  rƒ   rµ  r–  r¶  rW   r   r   r·  s   `   r/   Útest_simpleFailureÚ%RenderElementTests.test_simpleFailure(  s`   ø€ ô
 !Ó"ˆà�L‰L×%Ñ%Ó'ˆð	3”Vð 	3 ÷ 	3ð 	
�‰�eÔà×Ñœ\¬=¸¿¹ÀwÓ+OÔPàˆr2   c                 ó4  ^ ^• [         R                  " T [        5      mST R                  R                  l        [        5       nT R                  R                  5       nS[        SS4UU 4S jjnUR                  U5        [        T R                  U[        S9  U$ )z€
L{renderElement} will render a traceback when rendering of
the element fails and our site is configured to display tracebacks.
Tr­  rK   Nc                 ó   >• TR                  S[        T5      5        TS   S   nTR                  UR                  [        5        TR                  [        5      nTR                  [        U5      S5        TR                  SR                  TR                  R                  5      S5        TR                  TR                  R                  5        g )NrÉ   r   Úlog_failurer2   s    <!DOCTYPE html>
<p>I failed.</p>)ÚassertEqualsrÎ   r…  Úvaluer   r½  r*   r¯  rƒ   r°  r�  r±  )r­  Úfr¾  ÚlogObserverr-   s      €€r/   r³  ÚARenderElementTests.test_simpleFailureWithTraceback.<locals>.checkR  s�   ø€ Ø×Ñ˜a¤ [Ó!1Ô2Ø˜A‘˜}Ñ-ˆAØ×!Ñ! !§'¡'¬>Ô:Ø×,Ñ,¬^Ó<ˆGØ×ÑœS ›\¨1Ô-Ø×ÑØ—‘˜Ÿ™×-Ñ-Ó.Ð0Tôð �O‰O˜DŸL™L×1Ñ1Õ2r2   )Ú_failElement)r
   ÚcreateWithCleanupr   rƒ   r¤  rŸ  r˜  rµ  r–  r¶  r   r�  )r-   rX   r¸  r³  rÈ  s   `   @r/   Útest_simpleFailureWithTracebackÚ2RenderElementTests.test_simpleFailureWithTracebackF  s€   ù€ ô
 +×<Ò<¸TÔCUÓVˆØ.2ˆ�‰×ÑÔ+ä Ó"ˆà�L‰L×%Ñ%Ó'ˆð		3”Vð 		3 ÷ 		3ð 		3ð 	
�‰�eÔä�d—l‘l GÔ:LÒMàˆr2   c                 ó¼   ^ • [        5       nT R                  R                  5       nS[        SS4U 4S jjnUR	                  U5        [        T R                  USS9  U$ )z[
L{renderElement} will write the doctype string specified by the
doctype keyword argument.
r­  rK   Nc                 óp   >• TR                  SR                  TR                  R                  5      S5        g )Nr2   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>©r*   r¯  rƒ   r°  r²  s    €r/   r³  Ú8RenderElementTests.test_nonDefaultDoctype.<locals>.checkl  s,   ø€ Ø×ÑØ—‘˜Ÿ™×-Ñ-Ó.ð,õr2   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   r·  s   `   r/   Útest_nonDefaultDoctypeÚ)RenderElementTests.test_nonDefaultDoctypec  s^   ø€ ô
 “-ˆà�L‰L×%Ñ%Ó'ˆð	”Vð 	 ÷ 	ð 	
�‰�eÔäØ�L‰LØðIò		
ð ˆr2   c                 ó¼   ^ • [        5       nT R                  R                  5       nS[        SS4U 4S jjnUR	                  U5        [        T R                  USS9  U$ )z[
L{renderElement} will not write out a doctype if the doctype keyword
argument is L{None}.
r­  rK   Nc                 óp   >• TR                  SR                  TR                  R                  5      S5        g )Nr2   rö   rÐ  r²  s    €r/   r³  Ú2RenderElementTests.test_noneDoctype.<locals>.checkŒ  s'   ø€ Ø×Ñ˜SŸX™X d§l¡l×&:Ñ&:Ó;Ð=TÕUr2   rÒ  rÔ  r·  s   `   r/   Útest_noneDoctypeÚ#RenderElementTests.test_noneDoctypeƒ  sW   ø€ ô
 “-ˆà�L‰L×%Ñ%Ó'ˆð	V”Vð 	V ÷ 	Vð 	
�‰�eÔä�d—l‘l G°TÒ:àˆr2   )rƒ   rJ   )rL   rM   rN   rO   rP   r~  r   r¹  rÀ  rÌ  rÕ  rÚ  rQ   rI   r2   r/   r©  r©    s]   † ñô,ð 8¨D¡>ô ð. H¨T¡Nô ð<°¸$±ô ð:¨°©ô ð@ (¨4¡.÷ r2   r©  )FrP   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&   rS   r«   r¾   rÝ   râ   rì   rð   rô   r{  rŽ  r�  r˜  rž  r¡  r©  rI   r2   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1ôj.˜8Ð%8ô .ô˜xÐ)<ô ô"6˜8Ð%8ô 6ô ˜xÐ)<ô  ô"S:˜oô S:ôl
:�_ô :ô:	�'ô 	ô˜ô ô �Wô ÷ñ ñ ˆXÓô
˜ó 
ó ð
ôM˜õ Mr2   