Skip to content

Commit

Permalink
Adapt test as IDs are now validated; do not force string casting for …
Browse files Browse the repository at this point in the history
…untyped fields
  • Loading branch information
blaise committed Sep 14, 2023
1 parent 501d600 commit 39905aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/xero/basemanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def get_filter_value(key, value, value_type=None):
value.hex if type(value) == UUID else UUID(value).hex
)
else:
return "%s" % str(value)
return value

def get_filter_params(key, value):
last_key = key.split("_")[-1]
Expand Down
9 changes: 7 additions & 2 deletions tests/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,18 @@ def test_filter_ids(self):
manager = Manager("contacts", credentials)

uri, params, method, body, headers, singleobject = manager._filter(
IDs=["1", "2", "3", "4", "5"]
IDs=[
"3e776c4b-ea9e-4bb1-96be-6b0c7a71a37f",
"12345678901234567890123456789012",
]
)

self.assertEqual(method, "get")
self.assertFalse(singleobject)

expected_params = {"IDs": "1,2,3,4,5"}
expected_params = {
"IDs": "3e776c4bea9e4bb196be6b0c7a71a37f,12345678901234567890123456789012"
}
self.assertEqual(params, expected_params)

def test_rawfilter(self):
Expand Down

0 comments on commit 39905aa

Please sign in to comment.