Beispiel #1
0
def local_script(path):
    with open(path) as f:
        code = f.read()
    return script()(code)
Beispiel #2
0
def remote_script(url):
    return script(src=url)
Beispiel #3
0
 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>
     '''))