Example #1
0
 def test_mixed(self):
     """All mixed up."""
     # <a b c> cañón +쏔
     res = magic_quote("%3Ca+b+c%3E+ca%C3%B1%C3%B3n+%2B%EC%8F%94")
     self.assertEqual(res, "&#60;a b c&#62; ca&#241;&#243;n &#43;&#50132;")
Example #2
0
 def test_triplechar(self):
     """Three chars, because of UTF8."""
     res = magic_quote("%EC%8F%94")  # 쏔
     self.assertEqual(res, "&#50132;")
Example #3
0
 def test_doublechar(self):
     """Two chars, because of UTF8."""
     res = magic_quote("%C3%B1")  # ñ
     self.assertEqual(res, "&#241;")
Example #4
0
 def test_singlechar(self):
     """One encoded char."""
     res = magic_quote("%3E")  # <
     self.assertEqual(res, "&#62;")
Example #5
0
 def test_plus(self):
     """Specially encoded +."""
     res = magic_quote("+")  # space
     self.assertEqual(res, " ")
Example #6
0
 def test_unencoded(self):
     """Unencoded stuff."""
     inp = "some content"
     out = magic_quote(inp)
     self.assertEqual(inp, out)