| Conditions | 1 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # -*- coding: utf-8 -*- |
||
| 32 | def test_dict_to_xml(self): |
||
| 33 | from wechatpy.pay import dict_to_xml |
||
| 34 | |||
| 35 | params = { |
||
| 36 | 'test1': 'test1', |
||
| 37 | 'test2': 'test2', |
||
| 38 | } |
||
| 39 | sign = '1E3A8D73B5A4AEE787C0F68B5DAB8520' |
||
| 40 | expected = ( |
||
| 41 | '<xml>\n<test1><![CDATA[test1]]></test1>\n' |
||
| 42 | '<test2><![CDATA[test2]]></test2>\n' |
||
| 43 | '<sign><![CDATA[1E3A8D73B5A4AEE787C0F68B5DAB8520]]></sign>\n</xml>' |
||
| 44 | ) |
||
| 45 | xml = dict_to_xml(params, sign) |
||
| 46 | self.assertEqual(expected, xml) |
||
| 47 |