Skip to content

Commit

Permalink
Merge pull request #8671 from FelixHernandez/sc-1392
Browse files Browse the repository at this point in the history
Allow PUT in risk acceptance update
  • Loading branch information
grendel513 authored Sep 19, 2023
2 parents b1add18 + 8eb6999 commit e170b82
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions dojo/api_v2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ class RiskAcceptanceViewSet(
mixins.ListModelMixin,
mixins.RetrieveModelMixin,
mixins.DestroyModelMixin,
mixins.UpdateModelMixin,
viewsets.GenericViewSet,
dojo_mixins.DeletePreviewModelMixin,
):
Expand Down
25 changes: 25 additions & 0 deletions unittests/test_rest_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,8 +935,33 @@ def __init__(self, *args, **kwargs):
self.endpoint_path = 'risk_acceptance'
self.viewname = 'risk_acceptance'
self.viewset = RiskAcceptanceViewSet
self.payload = {
"id": 1,
"recommendation": "Fix (The risk is eradicated)",
"decision": "Accept (The risk is acknowledged, yet remains)",
"path": "No proof has been supplied",
"name": "string",
"recommendation_details": "string",
"decision_details": "string",
"accepted_by": "string",
"expiration_date": "2023-09-15T17:16:52.989000Z",
"expiration_date_warned": "2023-09-15T17:16:52.989000Z",
"expiration_date_handled": "2023-09-15T17:16:52.989000Z",
"reactivate_expired": True,
"restart_sla_expired": True,
"created": "2020-11-09T23:13:08.520000Z",
"updated": "2023-09-15T17:17:39.462854Z",
"owner": 1,
"accepted_findings": [
4
],
"notes": []
}
self.update_fields = {'name': 'newName'}
self.test_type = TestType.OBJECT_PERMISSIONS
self.permission_check_class = Risk_Acceptance
self.permission_create = Permissions.Risk_Acceptance
self.permission_update = Permissions.Risk_Acceptance
self.permission_delete = Permissions.Risk_Acceptance
self.deleted_objects = 3
BaseClass.RESTEndpointTest.__init__(self, *args, **kwargs)
Expand Down

0 comments on commit e170b82

Please sign in to comment.