Skip to content

Commit

Permalink
[IMP] Improved test readability somewhat
Browse files Browse the repository at this point in the history
  • Loading branch information
c8y3 committed Oct 2, 2024
1 parent 8e84e58 commit 3f536fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/tests_rest_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,16 @@ def test_get_task_should_return_403_when_user_has_insufficient_rights(self):
self.assertEqual(403, response.status_code)

def test_delete_task_should_return_403_when_user_has_insufficient_rights(self):
case_identifier = self._subject.create_dummy_case()
user = self._subject.create_dummy_user()
body = {'task_assignees_id': [1], 'task_description': '', 'task_status_id': 1, 'task_tags': '', 'task_title': 'dummy title', 'custom_attributes': {}}
response = self._subject.create(f'/api/v2/cases/{case_identifier}/tasks', body).json()
task_identifier = response['id']
body = {
'cases_list': [_INITIAL_DEMO_CASE_IDENTIFIER],
'access_level': _CASE_ACCESS_LEVEL_FULL_ACCESS
}
self._subject.create(f'/manage/users/{user.get_identifier()}/cases-access/update', body)
case_identifier = self._subject.create_dummy_case()
body = {'task_assignees_id': [1], 'task_description': '', 'task_status_id': 1, 'task_tags': '', 'task_title': 'dummy title', 'custom_attributes': {}}
response = self._subject.create(f'/api/v2/cases/{case_identifier}/tasks', body).json()
task_identifier = response['id']

response = user.delete(f'/api/v2/tasks/{task_identifier}')
self.assertEqual(403, response.status_code)

0 comments on commit 3f536fa

Please sign in to comment.