Пример #1
0
 def test_escape_slash(self):
     script = json_script(["</script>"])
     assert_equal(
         '<script type="application/json">["<\\/script>"]</script>',
         str(script))
Пример #2
0
 def test_script(self):
     script = json_script([1, 2, "a"])
     assert_equal('[1, 2, "a"]', script.script)
Пример #3
0
 def test_serialized(self):
     script = json_script([1, 2, "a"])
     assert_equal('<script type="application/json">[1, 2, "a"]</script>',
                  str(script))
Пример #4
0
 def test_element_type(self):
     script = json_script([])
     assert_is_instance(script, Script)
Пример #5
0
 def test_type(self):
     script = json_script([])
     assert_equal("application/json", script.type)
Пример #6
0
 def test_escape_slash(self):
     script = json_script(["</script>"])
     assert_equal(
         '<script type="application/json">["<\\/script>"]</script>',
         str(script),
     )
Пример #7
0
 def test_serialized(self):
     script = json_script([1, 2, "a"])
     assert_equal('<script type="application/json">[1, 2, "a"]</script>',
                  str(script))
Пример #8
0
 def test_script(self):
     script = json_script([1, 2, "a"])
     assert_equal('[1, 2, "a"]', script.script)
Пример #9
0
 def test_type(self):
     script = json_script([])
     assert_equal("application/json", script.type)
Пример #10
0
 def test_element_type(self):
     script = json_script([])
     assert_is_instance(script, Script)