当前位置: 首页>>代码示例>>Python>>正文


Python ProgramFactory.create方法代码示例

本文整理汇总了Python中openedx.core.djangoapps.catalog.tests.factories.ProgramFactory.create方法的典型用法代码示例。如果您正苦于以下问题:Python ProgramFactory.create方法的具体用法?Python ProgramFactory.create怎么用?Python ProgramFactory.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在openedx.core.djangoapps.catalog.tests.factories.ProgramFactory的用法示例。


在下文中一共展示了ProgramFactory.create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _create_catalog_program

# 需要导入模块: from openedx.core.djangoapps.catalog.tests.factories import ProgramFactory [as 别名]
# 或者: from openedx.core.djangoapps.catalog.tests.factories.ProgramFactory import create [as 别名]
 def _create_catalog_program(self, catalog_org):
     """ helper method to create a cached catalog program """
     program = ProgramFactory.create(
         authoring_organizations=[catalog_org]
     )
     cache.set(PROGRAM_CACHE_KEY_TPL.format(uuid=program['uuid']), program, None)
     return program
开发者ID:edx,项目名称:edx-platform,代码行数:9,代码来源:test_signals.py

示例2: setup_catalog_cache

# 需要导入模块: from openedx.core.djangoapps.catalog.tests.factories import ProgramFactory [as 别名]
# 或者: from openedx.core.djangoapps.catalog.tests.factories.ProgramFactory import create [as 别名]
 def setup_catalog_cache(self, program_uuid, organization_key):
     """
     helper function to initialize a cached program with an single authoring_organization
     """
     catalog_org = CatalogOrganizationFactory.create(key=organization_key)
     program = ProgramFactory.create(
         uuid=program_uuid,
         authoring_organizations=[catalog_org]
     )
     cache.set(PROGRAM_CACHE_KEY_TPL.format(uuid=program_uuid), program, None)
开发者ID:edx,项目名称:edx-platform,代码行数:12,代码来源:test_utils.py

示例3: test_catalog_program_missing_org

# 需要导入模块: from openedx.core.djangoapps.catalog.tests.factories import ProgramFactory [as 别名]
# 或者: from openedx.core.djangoapps.catalog.tests.factories.ProgramFactory import create [as 别名]
    def test_catalog_program_missing_org(self):
        """
        Test OrganizationDoesNotExistException is thrown if the cached program does not
        have an authoring organization.
        """
        program = ProgramFactory.create(
            uuid=self.program_uuid,
            authoring_organizations=[]
        )
        cache.set(PROGRAM_CACHE_KEY_TPL.format(uuid=self.program_uuid), program, None)

        organization = OrganizationFactory.create(short_name=self.organization_key)
        provider = SAMLProviderConfigFactory.create(organization=organization)
        self.create_social_auth_entry(self.user, provider, self.external_user_id)

        with pytest.raises(OrganizationDoesNotExistException):
            get_user_by_program_id(self.external_user_id, self.program_uuid)
开发者ID:edx,项目名称:edx-platform,代码行数:19,代码来源:test_utils.py


注:本文中的openedx.core.djangoapps.catalog.tests.factories.ProgramFactory.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。