#NEWLINE# def test_injections( self ) : #NEWLINE# #INDENT# testdata = ( ( '<img src="https://example.com/nursekitty.jpg">' , '<p><img src="https://example.com/nursekitty.jpg">\n</p>' ) , ( '<img src=https://example.com/nursekitty.jpg />' , '<p><img src="https://example.com/nursekitty.jpg">\n</p>' ) , ( '<img src="https://example.com/nursekitty.jpg" />' , '<p><img src="https://example.com/nursekitty.jpg">\n</p>' ) , ( '<img src=https://example.com/nursekitty.jpg </img>' , '<p><img src="https://example.com/nursekitty.jpg"></p>' ) , ( '<IMG SRC=`javascript:alert("\'XSS\'")`>' , '<p><img>\n</p>' ) , ( '<IMG SRC=javascript:alert("XSS")>' , '<p><img>\n</p>' ) , ( "<IMG SRC=JaVaScRiPt:alert('XSS')>" , '<p><img>\n</p>' ) , ( "<IMG SRC=javascript:alert('XSS')>" , '<p><img>\n</p>' ) , ( '<IMG SRC="javascript:alert(\'XSS\');">' , '<p><img>\n</p>' ) ) #NEWLINE# for ( content , expected ) in testdata : #NEWLINE# #INDENT# eq_ ( expected , self . p . parse ( self ) )