Skip to content

Commit

Permalink
Add a new method to the api client to allow it to undo the countersig…
Browse files Browse the repository at this point in the history
…ning of the framework agreement. This should only need to be used once and then we may consider removing it.

I have added tests for this new method.
  • Loading branch information
tim-s-ccs committed Sep 8, 2022
1 parent 49e53a5 commit dfb02d3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dmapiclient/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '23.1.2'
__version__ = '23.2.0'

from .errors import APIError, HTTPError, InvalidResponse # noqa
from .errors import REQUEST_ERROR_STATUS_CODE, REQUEST_ERROR_MESSAGE # noqa
Expand Down
7 changes: 7 additions & 0 deletions dmapiclient/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,13 @@ def update_framework_agreement(self, framework_agreement_id, framework_agreement
user=user,
)

def update_framework_agreement_undo_countersign(self, framework_agreement_id, user=None):
return self._post_with_updated_by(
"/agreements/{}/undo-countersign".format(framework_agreement_id),
data={},
user=user,
)

def sign_framework_agreement(self, framework_agreement_id, user, signed_agreement_details=None):
data = {"agreement": {"signedAgreementDetails": signed_agreement_details}} if signed_agreement_details else {}
return self._post_with_updated_by(
Expand Down
13 changes: 13 additions & 0 deletions tests/test_data_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2386,6 +2386,19 @@ def test_update_framework_agreement(self, data_client, rmock):
"updated_by": "[email protected]",
}

def test_update_framework_agreement_undo_countersign(self, data_client, rmock):
rmock.post(
"http://baseurl/agreements/12345/undo-countersign",
json={},
status_code=200)

result = data_client.update_framework_agreement_undo_countersign(12345, "[email protected]")

assert result == {}
assert rmock.last_request.json() == {
"updated_by": "[email protected]",
}

def test_sign_framework_agreement_with_no_signed_agreement_details(self, data_client, rmock):
rmock.post(
"http://baseurl/agreements/12345/sign",
Expand Down

0 comments on commit dfb02d3

Please sign in to comment.