From 5de5236d042c550a4d915d9c366fa6243fad8a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Evrim=20=C3=96ztamur?= Date: Wed, 27 Sep 2023 12:05:01 +0200 Subject: [PATCH 1/2] Fix superfluous JSON/XML tagging in PaymentManager --- src/xero/paymentmanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xero/paymentmanager.py b/src/xero/paymentmanager.py index 3860e5b..e4a68a8 100644 --- a/src/xero/paymentmanager.py +++ b/src/xero/paymentmanager.py @@ -21,5 +21,5 @@ def __init__(self, name, credentials, unit_price_4dps=False, user_agent=None): def _delete(self, id): uri = "/".join([self.base_url, self.name, id]) data = {"Status": "DELETED"} - body = {"xml": self._prepare_data_for_save(data)} + body = self._prepare_data_for_save(data) return uri, {}, "post", body, None, False From 23d90e8042c075a1e85851742896aa16e861a100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Evrim=20=C3=96ztamur?= Date: Wed, 27 Sep 2023 12:15:09 +0200 Subject: [PATCH 2/2] Update test_paymentmanager.py --- tests/test_paymentmanager.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_paymentmanager.py b/tests/test_paymentmanager.py index 5b8f53f..f17edd0 100644 --- a/tests/test_paymentmanager.py +++ b/tests/test_paymentmanager.py @@ -21,8 +21,7 @@ def test_delete(self): self.assertEqual(params, {}) self.assertEqual(method, "post") - self.assertIn("xml", body) - assertXMLEqual(self, body["xml"], "DELETED") + assertXMLEqual(self, body, "DELETED") self.assertIsNone(headers)