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