コード例 #1
0
    def test_organization_is_None_if_the_group_has_no_organization(
            self, factories, pyramid_request):
        group = factories.Group()

        group_context = GroupContext(group, pyramid_request)

        assert group_context.organization is None
コード例 #2
0
    def test_it_proxies_links_to_svc(self, factories, links_svc,
                                     pyramid_request):
        group = factories.Group()

        group_context = GroupContext(group, pyramid_request)

        assert group_context.links == links_svc.get_all.return_value
コード例 #3
0
    def test_it_returns_group_model_as_property(self, factories,
                                                pyramid_request):
        group = factories.Group()

        group_context = GroupContext(group, pyramid_request)

        assert group_context.group == group
コード例 #4
0
    def test_it_returns_None_for_missing_organization_relation(
            self, factories, pyramid_request):
        group = factories.Group()
        group.organization = None

        group_context = GroupContext(group, pyramid_request)

        assert group_context.organization is None
コード例 #5
0
    def test_it_expands_organization_if_the_group_has_one(
            self, factories, pyramid_request):
        organization = factories.Organization()
        group = factories.Group(organization=organization)

        group_context = GroupContext(group, pyramid_request)

        assert group_context.organization.organization == organization
コード例 #6
0
    def test_it_returns_pubid_as_id(self, factories, pyramid_request):
        group = factories.Group()

        group_context = GroupContext(group, pyramid_request)

        assert group_context.id == group.pubid  # NOT the group.id
コード例 #7
0
ファイル: contexts_test.py プロジェクト: ziqizh/h
    def test_it_expands_organization(self, factories, pyramid_request):
        group = factories.Group()

        group_context = GroupContext(group, pyramid_request)

        assert isinstance(group_context.organization, OrganizationContext)