diff --git a/capella2polarion/connectors/polarion_worker.py b/capella2polarion/connectors/polarion_worker.py index 0bbee57..3d9bf49 100644 --- a/capella2polarion/connectors/polarion_worker.py +++ b/capella2polarion/connectors/polarion_worker.py @@ -187,6 +187,9 @@ def compare_and_update_work_item( assert old is not None assert old.id is not None + if old.status == self.project_client.work_items.delete_status: + old.checksum = None + new.calculate_checksum() if not self.force_update and new.checksum == old.checksum: return diff --git a/tests/conftest.py b/tests/conftest.py index b27313a..a4d97ba 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -129,6 +129,9 @@ def _setup_polarion_worker( monkeypatch.setattr(polarion_api, "ProjectClient", mock_project_client) pw = polarion_worker.CapellaPolarionWorker(params) pw.project_client.work_items.create.side_effect = _set_work_item_id + pw.project_client.work_items.delete_status = ( + None if params.delete_work_items else "deleted" + ) return pw