def _encode(self, value):
     return json.b64encode(value)
 def test_b64encode(self):
     self.assertEqual(json.b64encode(
         '<script>alert("hello")</script>'),
         'IjxzY3JpcHQ+YWxlcnQoXCJoZWxsb1wiKTxcL3NjcmlwdD4i')