コード例 #1
0
    def wrapper(self, request):
        action = CrudActions.resolve_action(func.__name__)
        request.context_params['crud_action'] = action

        if not self.is_action_allowed(action):
            return Response(is_success=False,
                            reason=error_types.MethodNotAllowed)
        return func(self, request=request)
コード例 #2
0
ファイル: decorators.py プロジェクト: Aplopio/rip
    def wrapper(self, request):
        action = CrudActions.resolve_action(func.__name__)
        request.context_params['crud_action'] = action

        if not self.is_action_allowed(action):
            return Response(
                is_success=False, reason=error_types.MethodNotAllowed)
        return func(self, request=request)
コード例 #3
0
ファイル: test_crud_actions.py プロジェクト: Aplopio/rip
    def test_should_get_all_actions(self):
        all_actions = CrudActions.get_all_actions()

        assert len(all_actions) == 7
        assert CrudActions.READ_DETAIL in all_actions
        assert CrudActions.READ_LIST in all_actions
        assert CrudActions.CREATE_DETAIL in all_actions
        assert CrudActions.UPDATE_DETAIL in all_actions
        assert CrudActions.CREATE_OR_UPDATE_DETAIL in all_actions
        assert CrudActions.DELETE_DETAIL in all_actions
        assert CrudActions.GET_AGGREGATES in all_actions
コード例 #4
0
ファイル: test_crud_actions.py プロジェクト: techiev2/rip
    def test_should_get_all_actions(self):
        all_actions = CrudActions.get_all_actions()

        assert len(all_actions) == 7
        assert CrudActions.READ_DETAIL in all_actions
        assert CrudActions.READ_LIST in all_actions
        assert CrudActions.CREATE_DETAIL in all_actions
        assert CrudActions.UPDATE_DETAIL in all_actions
        assert CrudActions.CREATE_OR_UPDATE_DETAIL in all_actions
        assert CrudActions.DELETE_DETAIL in all_actions
        assert CrudActions.GET_AGGREGATES in all_actions
コード例 #5
0
ファイル: test_crud_actions.py プロジェクト: Aplopio/rip
 def test_should_resolve_read_detail(self):
     assert CrudActions.resolve_action(
         'read_detail') == CrudActions.READ_DETAIL
コード例 #6
0
ファイル: test_crud_actions.py プロジェクト: Aplopio/rip
 def test_should_get_aggregates(self):
     assert CrudActions.resolve_action(
         'get_aggregates') == CrudActions.GET_AGGREGATES
コード例 #7
0
ファイル: test_crud_actions.py プロジェクト: Aplopio/rip
 def test_should_resolve_delete_detail(self):
     assert CrudActions.resolve_action(
         'delete_detail') == CrudActions.DELETE_DETAIL
コード例 #8
0
ファイル: test_crud_actions.py プロジェクト: Aplopio/rip
 def test_should_resolve_update_detail(self):
     assert CrudActions.resolve_action(
         'update_detail') == CrudActions.UPDATE_DETAIL
コード例 #9
0
ファイル: test_crud_actions.py プロジェクト: Aplopio/rip
 def test_should_resolve_create_detail(self):
     assert CrudActions.resolve_action(
         'create_detail') == CrudActions.CREATE_DETAIL
コード例 #10
0
ファイル: test_crud_actions.py プロジェクト: Aplopio/rip
 def test_should_resolve_read_list(self):
     assert CrudActions.resolve_action(
         'read_list') == CrudActions.READ_LIST
コード例 #11
0
ファイル: test_crud_actions.py プロジェクト: techiev2/rip
 def test_should_resolve_read_detail(self):
     assert CrudActions.resolve_action(
         'read_detail') == CrudActions.READ_DETAIL
コード例 #12
0
ファイル: test_crud_actions.py プロジェクト: techiev2/rip
 def test_should_get_aggregates(self):
     assert CrudActions.resolve_action(
         'get_aggregates') == CrudActions.GET_AGGREGATES
コード例 #13
0
ファイル: test_crud_actions.py プロジェクト: techiev2/rip
 def test_should_resolve_delete_detail(self):
     assert CrudActions.resolve_action(
         'delete_detail') == CrudActions.DELETE_DETAIL
コード例 #14
0
ファイル: test_crud_actions.py プロジェクト: techiev2/rip
 def test_should_resolve_update_detail(self):
     assert CrudActions.resolve_action(
         'update_detail') == CrudActions.UPDATE_DETAIL
コード例 #15
0
ファイル: test_crud_actions.py プロジェクト: techiev2/rip
 def test_should_resolve_create_detail(self):
     assert CrudActions.resolve_action(
         'create_detail') == CrudActions.CREATE_DETAIL
コード例 #16
0
ファイル: test_crud_actions.py プロジェクト: techiev2/rip
 def test_should_resolve_read_list(self):
     assert CrudActions.resolve_action('read_list') == CrudActions.READ_LIST