Skip to content

Commit

Permalink
feat: include created time in policy api response (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinan029 committed Aug 19, 2024
1 parent 4ecdb5e commit c1e2386
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class Meta:
'group_associations',
'late_redemption_allowed_until',
'is_late_redemption_allowed',
'created',
]
read_only_fields = fields

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ def test_detail_view(self, role_context_dict):
'group_associations': [str(enterprise_group_uuid)],
'late_redemption_allowed_until': None,
'is_late_redemption_allowed': False,
'created': self.redeemable_policy.created.strftime('%Y-%m-%dT%H:%M:%S.%fZ')
}, response.json())

@ddt.data(
Expand Down Expand Up @@ -408,6 +409,7 @@ def test_list_view(self, role_context_dict):
'group_associations': [],
'late_redemption_allowed_until': None,
'is_late_redemption_allowed': False,
'created': self.non_redeemable_policy.created.strftime('%Y-%m-%dT%H:%M:%S.%fZ')
},
{
'access_method': 'direct',
Expand Down Expand Up @@ -439,6 +441,7 @@ def test_list_view(self, role_context_dict):
'group_associations': [],
'late_redemption_allowed_until': None,
'is_late_redemption_allowed': False,
'created': self.redeemable_policy.created.strftime('%Y-%m-%dT%H:%M:%S.%fZ'),
},
]

Expand Down Expand Up @@ -540,6 +543,7 @@ def test_destroy_view(self, request_payload, expected_change_reason):
'group_associations': [],
'late_redemption_allowed_until': None,
'is_late_redemption_allowed': False,
'created': self.redeemable_policy.created.strftime('%Y-%m-%dT%H:%M:%S.%fZ'),
}
self.assertEqual(expected_response, response.json())

Expand Down Expand Up @@ -655,6 +659,7 @@ def test_update_views(self, is_patch, request_payload):
'assignment_configuration': None,
'group_associations': [],
'is_late_redemption_allowed': False,
'created': policy_for_edit.created.strftime('%Y-%m-%dT%H:%M:%S.%fZ'),
}

if 'retired' in request_payload:
Expand Down

0 comments on commit c1e2386

Please sign in to comment.