def html(self): htmlfile = open(self.fullname + '.htm', 'r') html = htmlfile.read() htmlfile.close() html = scrubHTMLNoRaise(html) body = bodyfinder(html) return body
def html(self): htmlfile = open(self.outputfile, "r") html = htmlfile.read() htmlfile.close() html = scrubHTMLNoRaise(html) body = bodyfinder(html) return body
def html(self): htmlfile = open("%s/%s.html" % (self.tmpdir, self.__name__), 'r') html = htmlfile.read() htmlfile.close() html = scrubHTMLNoRaise(html) body = bodyfinder(html) return body
def html(self): htmlfile = open(self.fullname + '.htm', 'r') html = htmlfile.read() htmlfile.close() html = scrubHTMLNoRaise(html) body = bodyfinder(html) return body
def html(self): htmlfile = open("%s/%s.html" % (self.tmpdir, self.__name__), 'r') html = htmlfile.read() htmlfile.close() html = scrubHTMLNoRaise(html) body = bodyfinder(html) return body
def html(self): htmlfile = open(self.outputfile, 'r') html = htmlfile.read() htmlfile.close() html = scrubHTMLNoRaise(html) body = bodyfinder(html) return body
def test_javascript_uri(self): from Products.PortalTransforms.libtransforms.utils import scrubHTMLNoRaise, scrubHTML from Products.PortalTransforms.libtransforms.utils import IllegalHTML htmlFile = open(input_file_path("test_js_uri.html"), "rb") data = htmlFile.read() self.assertRaises(IllegalHTML, scrubHTML, data) result = scrubHTMLNoRaise(data) self.assertTrue("link" in result)
def test_javascript_uri(self): from Products.PortalTransforms.libtransforms.utils import ( scrubHTMLNoRaise, scrubHTML) from Products.PortalTransforms.libtransforms.utils import IllegalHTML htmlFile = open(input_file_path('test_js_uri.html'), 'rb') data = htmlFile.read() self.assertRaises(IllegalHTML, scrubHTML, data) result = scrubHTMLNoRaise(data) self.assertTrue('link' in result)
def test_javascript_on_attr(self): from Products.PortalTransforms.libtransforms.utils import ( scrubHTMLNoRaise, scrubHTML) from Products.PortalTransforms.libtransforms.utils import IllegalHTML htmlFile = open(input_file_path('test_js_on.html'), 'rb') data = htmlFile.read() self.assertRaises(IllegalHTML, scrubHTML, data) result = scrubHTMLNoRaise(data) self.assertTrue('link' in result)
def test_invalid_tags(self): htmlFile = open(input_file_path('test_invalid_tags.html'), 'rb') data = htmlFile.read() self.assertEqual(scrubHTMLNoRaise(data).strip(), '')
def test_javascript_uri(self): htmlFile = open(input_file_path('test_js_uri.html'), 'rb') data = htmlFile.read() result = scrubHTMLNoRaise(data) self.assertTrue('link' in result)