MCPcopy
hub / github.com/wechatpy/wechatpy / test_base64encode_field_to_xml

Method test_base64encode_field_to_xml

tests/test_fields.py:157–165  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

155 assert expected in field.to_xml(articles)
156
157 def test_base64encode_field_to_xml(self):
158 from wechatpy.fields import Base64EncodeField
159
160 content = b'test'
161 field = Base64EncodeField('Content')
162 expected = '<Content><![CDATA[{content}]]></Content>'.format(
163 content=to_text(base64.b64encode(content))
164 )
165 self.assertEqual(expected, field.to_xml(content))
166
167 def test_base64decode_field_to_xml(self):
168 from wechatpy.fields import Base64DecodeField

Callers

nothing calls this directly

Calls 3

Base64EncodeFieldClass · 0.90
to_textFunction · 0.90
to_xmlMethod · 0.45

Tested by

no test coverage detected