def modulestore():
 def load_function(engine_path):
  '\n        Load the given engine\n        '
  (module_path, _, name) = engine_path.rpartition('.')
  return getattr(importlib.import_module(module_path), name)
 if (ModuleStoreNoSettings.modulestore is None):
  class_ = load_function(ModuleStoreNoSettings.MODULESTORE['ENGINE'])
  options = {}
  options.update(ModuleStoreNoSettings.MODULESTORE['OPTIONS'])
  options['render_template'] = render_to_template_mock
  ModuleStoreNoSettings.modulestore = class_(None, ModuleStoreNoSettings.MODULESTORE['DOC_STORE_CONFIG'], branch_setting_func=(lambda : ModuleStoreEnum.Branch.draft_preferred), **options)
 return ModuleStoreNoSettings.modulestore

def modulestore ( ) : def load_function ( engine_path ) : ( module_path , _ , name ) = engine_path . rpartition ( '.' ) return getattr ( importlib . import_module ( module_path ) , name ) if ( ModuleStoreNoSettings . modulestore is None ) : class_ = load_function ( ModuleStoreNoSettings . MODULESTORE [ 'ENGINE' ] ) options = { } options . update ( ModuleStoreNoSettings . MODULESTORE [ 'OPTIONS' ] ) options [ 'render_template' ] = render_to_template_mock ModuleStoreNoSettings . modulestore = class_ ( None , ModuleStoreNoSettings . MODULESTORE [ 'DOC_STORE_CONFIG' ] , branch_setting_func = ( lambda : ModuleStoreEnum . Branch . draft_preferred ) , ** options ) return ModuleStoreNoSettings . modulestore
mock the django dependent global modulestore function to disentangle tests from django .