@@ -285,9 +285,7 @@ def test_cdata_content(self):
285285 #'foo = </\nscript>',
286286 #'foo = </ script>',
287287 ]
288- tags = ['script' , 'style' , 'textarea' , 'title' ]
289- # test the following 'casing' for each tag: script, SCRIPT, Script etc.
290- elements = [f (tag ) for tag in tags for f in (str .lower , str .upper , str .capitalize )]
288+ elements = ['script' , 'style' , 'SCRIPT' , 'STYLE' , 'Script' , 'Style' ]
291289 for content in contents :
292290 for element in elements :
293291 element_lower = element .lower ()
@@ -319,34 +317,6 @@ def get_events(self):
319317 ("endtag" , element_lower )],
320318 collector = Collector (convert_charrefs = False ))
321319
322- def test_escapable_raw_text_content (self ):
323- contents = [
324- 'foo = "</TITLE" + ">";' ,
325- 'foo = <\n /title> ' ,
326- '<!-- document.write("</scr" + "ipt>"); -->' ,
327- '\n //<![CDATA[\n '
328- '\n <!-- //\n var foo = 3.14;\n // -->\n ' ,
329- # valid character reference
330- 'A' ,
331- # ambiguous ampersand example
332- '¬aref' ,
333- 'foo = "</sty" + "le>";' ,
334- '<!-- \u2603 -->' ,
335- # these two should be invalid according to the HTML 5 spec,
336- # section 8.1.2.2
337- #'foo = </\nscript>',
338- #'foo = </ script>',
339- ]
340- elements = ['title' , 'textarea' , 'TITLE' , 'TEXTAREA' , 'Title' , 'Textarea' ]
341- for content in contents :
342- for element in elements :
343- element_lower = element .lower ()
344- s = '<{element}>{content}</{element}>' .format (element = element ,
345- content = content )
346- self ._run_check (s , [("starttag" , element_lower , []),
347- ("data" , content ),
348- ("endtag" , element_lower )])
349-
350320 def test_EOF_in_cdata (self ):
351321 content = """<!-- not a comment --> ¬-an-entity-ref;
352322 <a href="" /> </p><p> <span></span></style>
@@ -407,15 +377,9 @@ def test_convert_charrefs(self):
407377 ('starttag' , 'script' , []), ('data' , text ),
408378 ('endtag' , 'script' ), ('data' , '"' ),
409379 ('starttag' , 'style' , []), ('data' , text ),
410- ('endtag' , 'style' ), ('data' , '"' ),
411- ('starttag' , 'title' , []), ('data' , text ),
412- ('endtag' , 'title' ), ('data' , '"' ),
413- ('starttag' , 'textarea' , []), ('data' , text ),
414- ('endtag' , 'textarea' ), ('data' , '"' )]
380+ ('endtag' , 'style' ), ('data' , '"' )]
415381 self ._run_check ('{1}<script>{0}</script>{1}'
416- '<style>{0}</style>{1}'
417- '<title>{0}</title>{1}'
418- '<textarea>{0}</textarea>{1}' .format (text , charref ),
382+ '<style>{0}</style>{1}' .format (text , charref ),
419383 expected , collector = collector ())
420384 # check truncated charrefs at the end of the file
421385 html = '&quo &# &#x'
@@ -922,4 +886,4 @@ def test_base_class_methods_called(self, super_reset_method, super_init_method):
922886
923887
924888if __name__ == "__main__" :
925- unittest .main ()
889+ unittest .main ()
0 commit comments