def local_script(path): with open(path) as f: code = f.read() return script()(code)
def remote_script(url): return script(src=url)
def test_script_tag(self): dom = script(language="javascript")("console.log('omg!')") self.assertEqual(str(dom), normalize_whitespace(''' <script language="javascript">console.log('omg!')</script> '''))