def test_api_decode_from_mongo(self):
        field = "$section1.group01.question1"
        encoded = _encode_for_mongo(field)
        self.assertEqual(encoded, ("%(dollar)ssection1%(dot)sgroup01%(dot)squestion1" % \
                                   {"dollar": base64.b64encode("$"), \
                                    "dot": base64.b64encode(".")}))
        decoded = _decode_from_mongo(encoded)
        self.assertEqual(field, decoded)