def test_delete_project_members_similar_request(self, mock_db, mock_print): mock_db().get_created_by_id.return_value = ['bdo_id'] mock_db().get_approvals_list.return_value = [[ 'WAGE|member1|member_id|project_id|project1' ]] gpm = GPM() gpm.project_id = 'project_id' gpm.gpm_id = 'gpm_id' gpm.member_id = 'member_id' gpm.delete_project_request() mock_db().get_created_by_id.assert_called_once() mock_db().get_approvals_list.assert_called_once() mock_print.assert_called_once()
def test_delete_project_members_request(self, mock_db, mock_print): mock_db().get_created_by_id.return_value = ['bdo_id'] mock_db().get_approvals_list.return_value = [[ 'WAGE|member1|cc29a75e-8bf8-48e0-85f5-6990f4cc87e8|4b602623-' '8d64-4fdf-8e9f-18b7b3f4389b|project1' ]] mock_db().get_user_name.return_value = ['name'] mock_db().get_project_name.return_value = ['project_name'] gpm = GPM() gpm.project_id = 'project_id' gpm.gpm_id = 'gpm_id' gpm.member_id = 'member_id' gpm.delete_project_request() mock_db().get_created_by_id.assert_called_once() mock_db().get_approvals_list.assert_called_once() mock_db().get_user_name.assert_called_once_with('member_id') mock_db().get_project_name.assert_called_once_with('project_id') mock_db().register_complain.assert_called_once() mock_db().commit_data.assert_called_once() mock_print.assert_called_once()