예제 #1
0
파일: groups_test.py 프로젝트: timgates42/h
    def test_it_creates_group_context_from_group_model(
        self, GroupContext, factories, pyramid_request
    ):
        group = factories.Group()

        views.read(group, pyramid_request)

        GroupContext.assert_called_once_with(group, pyramid_request)
예제 #2
0
파일: groups_test.py 프로젝트: hypothesis/h
    def test_it_creates_group_context_from_group_model(
        self, GroupContext, factories, pyramid_request
    ):
        group = factories.Group()

        views.read(group, pyramid_request)

        GroupContext.assert_called_once_with(group, pyramid_request)
예제 #3
0
파일: groups_test.py 프로젝트: timgates42/h
    def test_it_forwards_expand_param_to_presenter(
        self, GroupJSONPresenter, factories, pyramid_request
    ):
        pyramid_request.params["expand"] = "organization"
        group = factories.Group()

        views.read(group, pyramid_request)

        GroupJSONPresenter.return_value.asdict.assert_called_once_with(["organization"])
예제 #4
0
파일: groups_test.py 프로젝트: hypothesis/h
    def test_it_forwards_expand_param_to_presenter(
        self, GroupJSONPresenter, factories, pyramid_request
    ):
        pyramid_request.params["expand"] = "organization"
        group = factories.Group()

        views.read(group, pyramid_request)

        GroupJSONPresenter.return_value.asdict.assert_called_once_with(["organization"])
예제 #5
0
파일: groups_test.py 프로젝트: magnuslim/h
    def test_it_returns_presented_group(self, GroupJSONPresenter, factories,
                                        pyramid_request):
        pyramid_request.params["expand"] = "organization"
        group = factories.Group()

        presented = views.read(group, pyramid_request)

        assert presented == GroupJSONPresenter.return_value.asdict.return_value
예제 #6
0
파일: groups_test.py 프로젝트: hypothesis/h
    def test_it_returns_presented_group(
        self, GroupJSONPresenter, factories, pyramid_request
    ):
        pyramid_request.params["expand"] = "organization"
        group = factories.Group()

        presented = views.read(group, pyramid_request)

        assert presented == GroupJSONPresenter.return_value.asdict.return_value
예제 #7
0
    def test_it(self, context, pyramid_request, GroupJSONPresenter):
        pyramid_request.params["expand"] = "organization"

        result = views.read(context, pyramid_request)

        GroupJSONPresenter.assert_called_once_with(context.group,
                                                   pyramid_request)
        GroupJSONPresenter.return_value.asdict.assert_called_once_with(
            ["organization"])
        assert result == GroupJSONPresenter.return_value.asdict.return_value