Skip to content

Commit b98741c

Browse files
committed
fix: Patch request does not work with attributes unset
1 parent b800522 commit b98741c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

polarion_rest_api_client/clients/work_items.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ def _build_work_item_type_change_patch_item(
742742
return api_models.WorkitemsListPatchRequestDataItem(
743743
type_=api_models.WorkitemsListPatchRequestDataItemType.WORKITEMS,
744744
id=f"{self._project_id}/{work_item.id}",
745-
attributes=oa_types.UNSET,
745+
attributes=api_models.WorkitemsListPatchRequestDataItemAttributes(),
746746
)
747747

748748
def _has_content_to_patch(self, work_item: dm.WorkItem) -> bool:

tests/test_client_workitems.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ def test_update_work_item_pure_type_change_single_request(
619619
assert req.url.params["changeTypeTo"] == "newType"
620620
req_data = json.loads(req.content.decode("utf-8"))
621621
assert len(req_data["data"]) == 1
622-
assert "attributes" not in req_data["data"][0]
622+
assert req_data["data"][0].get("attributes") == {}
623623

624624

625625
def test_update_work_items_split_by_type(

0 commit comments

Comments
 (0)