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
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
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
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
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
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
def test_it_expands_organization(self, factories, pyramid_request): group = factories.Group() group_context = GroupContext(group, pyramid_request) assert isinstance(group_context.organization, OrganizationContext)