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


Python _CONTENTSTORE.clear函数代码示例

本文整理汇总了Python中xmodule.contentstore.django._CONTENTSTORE.clear函数的典型用法代码示例。如果您正苦于以下问题:Python clear函数的具体用法?Python clear怎么用?Python clear使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: drop_mongo_collections

 def drop_mongo_collections():
     """
     If using a Mongo-backed modulestore & contentstore, drop the collections.
     """
     module_store = modulestore()
     if hasattr(module_store, '_drop_database'):
         module_store._drop_database()  # pylint: disable=protected-access
     _CONTENTSTORE.clear()
开发者ID:AsylumCorp,项目名称:edx-platform,代码行数:8,代码来源:django_utils.py

示例2: reset_databases

def reset_databases(scenario):
    '''
    After each scenario, all databases are cleared/dropped.  Contentstore data are stored in unique databases
    whereas modulestore data is in unique collection names.  This data is created implicitly during the scenarios.
    If no data is created during the test, these lines equivilently do nothing.
    '''
    xmodule.modulestore.django.modulestore()._drop_database()  # pylint: disable=protected-access
    xmodule.modulestore.django.clear_existing_modulestores()
    _CONTENTSTORE.clear()
开发者ID:Certific-NET,项目名称:edx-platform,代码行数:9,代码来源:browser.py

示例3: clear_courses

def clear_courses():
    # Flush and initialize the module store
    # Note that if your test module gets in some weird state
    # (though it shouldn't), do this manually
    # from the bash shell to drop it:
    # $ mongo test_xmodule --eval "db.dropDatabase()"
    modulestore()._drop_database()  # pylint: disable=protected-access
    _CONTENTSTORE.clear()
    clear_existing_modulestores()
开发者ID:189140879,项目名称:edx-platform,代码行数:9,代码来源:course_helpers.py

示例4: reset_databases

def reset_databases(scenario):
    '''
    After each scenario, all databases are cleared/dropped.  Contentstore data are stored in unique databases
    whereas modulestore data is in unique collection names.  This data is created implicitly during the scenarios.
    If no data is created during the test, these lines equivilently do nothing.
    '''
    mongo = MongoClient()
    mongo.drop_database(settings.CONTENTSTORE['OPTIONS']['db'])
    _CONTENTSTORE.clear()
    modulestore = xmodule.modulestore.django.modulestore()
    modulestore.collection.drop()
    xmodule.modulestore.django._MODULESTORES.clear()
开发者ID:Mtax,项目名称:MHST2013-14,代码行数:12,代码来源:browser.py

示例5: reset_databases

def reset_databases(scenario):
    '''
    After each scenario, all databases are cleared/dropped.  Contentstore data are stored in unique databases
    whereas modulestore data is in unique collection names.  This data is created implicitly during the scenarios.
    If no data is created during the test, these lines equivilently do nothing.
    '''
    modulestore = xmodule.modulestore.django.modulestore()._get_modulestore_by_type(ModuleStoreEnum.Type.mongo)
    modulestore.contentstore.drop_database()
    _CONTENTSTORE.clear()

    modulestore.collection.drop()
    xmodule.modulestore.django.clear_existing_modulestores()
开发者ID:AlexanderFuentes,项目名称:edx-platform,代码行数:12,代码来源:browser.py

示例6: drop_mongo_collections

def drop_mongo_collections(mock_create):
    """
    If using a Mongo-backed modulestore & contentstore, drop the collections.
    """
    # Do not create the modulestore if it does not exist.
    mock_create.return_value = None

    module_store = modulestore()
    if hasattr(module_store, '_drop_database'):
        module_store._drop_database(database=False)  # pylint: disable=protected-access
    _CONTENTSTORE.clear()
    if hasattr(module_store, 'close_connections'):
        module_store.close_connections()
开发者ID:mitocw,项目名称:edx-platform,代码行数:13,代码来源:django_utils.py

示例7: drop_mongo_collections

    def drop_mongo_collections():
        """
        If using a Mongo-backed modulestore & contentstore, drop the collections.
        """
        module_store = modulestore()
        if hasattr(module_store, '_drop_database'):
            module_store._drop_database()  # pylint: disable=protected-access
        _CONTENTSTORE.clear()

        location_mapper = loc_mapper()
        if location_mapper.db:
            location_mapper.location_map.drop()
            location_mapper.db.connection.close()
开发者ID:AshWilliams,项目名称:edx-platform,代码行数:13,代码来源:django_utils.py

示例8: reset_databases

def reset_databases(scenario):
    """
    After each scenario, all databases are cleared/dropped.  Contentstore data are stored in unique databases
    whereas modulestore data is in unique collection names.  This data is created implicitly during the scenarios.
    If no data is created during the test, these lines equivilently do nothing.
    """
    mongo = MongoClient()
    mongo.drop_database(settings.CONTENTSTORE["OPTIONS"]["db"])
    _CONTENTSTORE.clear()

    modulestore = xmodule.modulestore.django.editable_modulestore()
    modulestore.collection.drop()
    xmodule.modulestore.django.clear_existing_modulestores()
开发者ID:nealmcb,项目名称:edx-platform,代码行数:13,代码来源:browser.py

示例9: tearDown

 def tearDown(self):
     shutil.rmtree(self.content_dir)
     MongoClient().drop_database(TEST_DATA_CONTENTSTORE['DOC_STORE_CONFIG']['db'])
     _CONTENTSTORE.clear()
开发者ID:1amongus,项目名称:edx-platform,代码行数:4,代码来源:test_import_export.py

示例10: tearDown

    def tearDown(self):

        MongoClient().drop_database(TEST_DATA_CONTENTSTORE['DOC_STORE_CONFIG']['db'])
        _CONTENTSTORE.clear()
开发者ID:OmarIthawi,项目名称:edraak,代码行数:4,代码来源:test.py

示例11: tearDown

 def tearDown(self):
     shutil.rmtree(self.content_dir)
     modulestore().contentstore.drop_database()
     _CONTENTSTORE.clear()
开发者ID:ibrahima,项目名称:edx-platform,代码行数:4,代码来源:test_import_export.py

示例12: tearDown

 def tearDown(self):
     modulestore().contentstore.drop_database()
     _CONTENTSTORE.clear()
开发者ID:karthikbangera87,项目名称:edx-platform,代码行数:3,代码来源:test_export_git.py

示例13: tearDown

 def tearDown(self):
     MongoClient().drop_database(TEST_DATA_CONTENTSTORE['OPTIONS']['db'])
     _CONTENTSTORE.clear()
开发者ID:NikolayStrekalov,项目名称:edx-platform,代码行数:3,代码来源:test_import_nostatic.py

示例14: tearDown

 def tearDown(self):
     self.clear_subs_content()
     contentstore().drop_database()
     _CONTENTSTORE.clear()
开发者ID:AlexanderFuentes,项目名称:edx-platform,代码行数:4,代码来源:test_transcripts_utils.py


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