• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python test_utils.setup_test_storage函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setUpClass

 def setUpClass(cls):
     """
     Set up the view
     """
     LOGGER.info("running '{}' tests...".format(cls.__name__))
     test_utils.setup_test_storage()
     cls.importPublishedFixtures()
开发者ID:ELDAELRA,项目名称:META-SHARE-3.1.1,代码行数:7,代码来源:test_search.py


示例2: setUpClass

 def setUpClass(cls):
     """
     Import a resource to test the workflow changes for
     """
     LOGGER.info("running '{}' tests...".format(cls.__name__))
     test_utils.set_index_active(False)        
     test_utils.setup_test_storage()
     _test_editor_group = \
         EditorGroup.objects.create(name='test_editor_group')
     _test_manager_group = \
         EditorGroupManagers.objects.create(name='test_manager_group',
                                            managed_group=_test_editor_group)            
     owner = test_utils.create_manager_user(
         'manageruser', '[email protected]', 'secret',
         (_test_editor_group, _test_manager_group))       
     
     # load first resource
     _fixture = '{0}/repository/fixtures/testfixture.xml'.format(ROOT_PATH)
     _result = test_utils.import_xml(_fixture)
     _result.editor_groups.add(_test_editor_group)
     _result.owners.add(owner)
     # load second resource
     _fixture = '{0}/repository/test_fixtures/ingested-corpus-AudioVideo-French.xml'.format(ROOT_PATH)
     _result = test_utils.import_xml(_fixture)
     _result.editor_groups.add(_test_editor_group)
     _result.owners.add(owner)
     
     # create a normal user
     test_utils.create_user('user', '[email protected]', 'mypasswd')
开发者ID:Atala,项目名称:META-SHARE,代码行数:29,代码来源:tests.py


示例3: setUp

 def setUp(self):
     """
     Import test fixtures and add resource pairs to TogetherManager
     """
     test_utils.setup_test_storage()
     self.res_1 = _import_resource('elra112.xml')
     self.res_2 = _import_resource('elra135.xml')
     self.res_3 = _import_resource('elra260.xml')
     self.res_4 = _import_resource('elra295.xml')
     man = TogetherManager.getManager(Resource.VIEW)
     count = 0
     while (count < 5):
         man.addResourcePair(self.res_1, self.res_2)
         count += 1
     count = 0
     while (count < 10):
         man.addResourcePair(self.res_1, self.res_3)
         count += 1
     count = 0
     while (count < 3):
         man.addResourcePair(self.res_1, self.res_4)
         count += 1
     man = TogetherManager.getManager(Resource.DOWNLOAD)
     count = 0
     while (count < 15):
         man.addResourcePair(self.res_1, self.res_2)
         count += 1
     count = 0
     while (count < 10):
         man.addResourcePair(self.res_1, self.res_3)
         count += 1
     count = 0
     while (count < 5):
         man.addResourcePair(self.res_1, self.res_4)
         count += 1
开发者ID:MiltosD,项目名称:CEFELRC,代码行数:35,代码来源:tests.py


示例4: setUp

 def setUp(self):
     """
     Set up the view
     """
     test_utils.setup_test_storage()
     normaluser = create_user('normaluser', '[email protected]', 'secret')
     normaluser.save()
开发者ID:ELDAELRA,项目名称:META-SHARE-3.1.1,代码行数:7,代码来源:test_search.py


示例5: setUp

 def setUp(self):
     """
     Imports a few test resources.
     """
     test_utils.setup_test_storage()
     self.test_res_1 = test_utils.import_xml("{0}/repository/fixtures/testfixture.xml".format(ROOT_PATH))
     self.test_res_2 = test_utils.import_xml("{0}/repository/fixtures/ILSP10.xml".format(ROOT_PATH))
开发者ID:JuliBakagianni,项目名称:CEF-ELRC,代码行数:7,代码来源:test_model.py


示例6: import_test_resource

 def import_test_resource(cls, editor_group=None, path=TESTFIXTURE_XML):
     test_utils.setup_test_storage()
     result = test_utils.import_xml(path)
     resource = result[0]
     if not editor_group is None:
         resource.editor_groups.add(editor_group)
         resource.save()
     return resource
开发者ID:marc1s,项目名称:META-SHARE,代码行数:8,代码来源:test_editor.py


示例7: setUp

 def setUp(self):
     """
     Import a resource to test the workflow changes for
     """
     test_utils.setup_test_storage()
     _fixture = '{0}/repo2/fixtures/testfixture.xml'.format(ROOT_PATH)
     _result = test_utils.import_xml(_fixture)
     self.resource_id = _result[0].id
开发者ID:kperi,项目名称:META-SHARE,代码行数:8,代码来源:test_status_workflow.py


示例8: setUp

 def setUp(self):
     """
     Set up the email test
     """
     test_utils.setup_test_storage()
     _fixture = '{0}/repository/fixtures/testfixture.xml'.format(ROOT_PATH)
     self.resource = test_utils.import_xml(_fixture)
     self.resource.storage_object.published = True
     self.resource.storage_object.save()
开发者ID:Atala,项目名称:META-SHARE,代码行数:9,代码来源:test_email.py


示例9: setUpClass

 def setUpClass(cls):
     """
     Set up the view
     """
     LOGGER.info("running '{}' tests...".format(cls.__name__))
     test_utils.setup_test_storage()                        
     # Make sure the index does not contain any stale entries:
     call_command('rebuild_index', interactive=False, using=settings.TEST_MODE_NAME)
     cls.importPublishedFixtures()
开发者ID:jvivaldi,项目名称:META-SHARE,代码行数:9,代码来源:test_search.py


示例10: setUp

 def setUp(self):
     """
     Import test fixtures and add resource pairs to TogetherManager
     """
     test_utils.setup_test_storage()
     self.res_1 = _import_resource('creators-projects-1.xml')
     self.res_2 = _import_resource('creators-projects-2.xml')
     self.res_3 = _import_resource('creators-projects-3.xml')
     self.res_4 = _import_resource('creators-projects-4.xml')
开发者ID:Atala,项目名称:META-SHARE,代码行数:9,代码来源:test_special_queries.py


示例11: setUp

 def setUp(self):
     """
     Import test fixtures and add resource pairs to TogetherManager
     """
     test_utils.setup_test_storage()
     self.res_1 = _import_resource('creators-projects-1.xml')
     self.res_2 = _import_resource('creators-projects-2.xml')
     self.res_3 = _import_resource('creators-projects-3.xml')
     self.res_4 = _import_resource('creators-projects-4.xml')
     update_index.Command().handle(using=[settings.TEST_MODE_NAME,])
开发者ID:ELDAELRA,项目名称:META-SHARE-3.1.1,代码行数:10,代码来源:test_special_queries.py


示例12: setUp

    def setUp(self):
        """
        Set up the import test
        """        
        test_utils.setup_test_storage()
        
        ImportTest.test_editor_group = EditorGroup.objects.create(
                                                    name='test_editor_group')

        ImportTest.super_user = User.objects.create_superuser('superuser', '[email protected]', 'secret')
开发者ID:Atala,项目名称:META-SHARE,代码行数:10,代码来源:test_import.py


示例13: setUp

    def setUp(self):
        """
        Set up the view
        """
        test_utils.setup_test_storage()

        staffuser = create_user("staffuser", "[email protected]", "secret")
        staffuser.is_staff = True
        staffuser.save()
        normaluser = create_user("normaluser", "[email protected]", "secret")
        normaluser.save()
开发者ID:marc1s,项目名称:META-SHARE,代码行数:11,代码来源:test_search.py


示例14: setUp

 def setUp(self):
     """
     Creates a new storage object instance for testing.
     """
     test_utils.setup_test_storage()
     folder = '{0}/storage/test_fixtures/updatetest'.format(settings.ROOT_PATH)
     with open('{0}/storage-global.json'.format(folder), 'rb') as storagein:
         self.storage_json = json.load(storagein)
     with open('{0}/metadata-before.xml'.format(folder), 'rb') as metadatain:
         self.metadata_before = metadatain.read()
     with open('{0}/metadata-modified.xml'.format(folder), 'rb') as metadatain:
         self.metadata_modified = metadatain.read()
     self.storage_id = self.storage_json['identifier']
开发者ID:marc1s,项目名称:META-SHARE,代码行数:13,代码来源:tests.py


示例15: setUp

 def setUp(self):
     """
     Set up the detail view
     """
     test_utils.setup_test_storage()
     create_user('normaluser', '[email protected]', 'secret')
     _test_editor_group = EditorGroup.objects.create(
                                                 name='test_editor_group')
     self.resource = _import_resource('testfixture.xml',
                                      _test_editor_group)
     ViewTest.test_editor = test_utils.create_editor_user('editoruser',
         '[email protected]', 'secret', (_test_editor_group,))          
     test_utils.create_manager_user('manageruser', '[email protected]',
         'secret', (EditorGroupManagers.objects.create(
                         name='test_editor_group_manager',
                         managed_group=_test_editor_group),))
开发者ID:JuliBakagianni,项目名称:CEF-ELRC,代码行数:16,代码来源:test_view.py


示例16: setUp

 def setUp(self):
     # make sure the index does not contain any stale entries
     call_command('rebuild_index', interactive=False, using=settings.TEST_MODE_NAME)
     # load test fixture; status will be set 'published'
     test_utils.setup_test_storage()
     import_dir(TESTFIXTURE_XML)
     
     # init Selenium
     driver = getattr(webdriver, settings.SELENIUM_DRIVER, None)
     assert driver, "settings.SELENIUM_DRIVER contains non-existing driver"
     self.driver = driver()
     self.driver.implicitly_wait(30)
     host = getattr(settings, 'SELENIUM_TESTSERVER_HOST', 'localhost')
     port = getattr(settings, 'SELENIUM_TESTSERVER_PORT', 8000)
     self.base_url = 'http://{0}:{1}/{2}'.format(host, port, DJANGO_BASE)
     self.verification_errors = []
开发者ID:marc1s,项目名称:META-SHARE,代码行数:16,代码来源:test_filter.py


示例17: setUp

 def setUp(self):
     """
     Sets up some resources with which to test.
     """
     test_utils.setup_test_storage()
     # set up different test resources
     self.non_downloadable_resource_id = _import_resource('testfixture.xml')
     self.downloadable_resource_id_1 = \
         _import_resource('downloadable_1_license.xml')
     self.downloadable_resource_id_2 = \
         _import_resource('downloadable_3_licenses.xml')
     # set up test users with and without staff permissions
     staffuser = User.objects.create_user('staffuser', '[email protected]',
                                          'secret')
     staffuser.is_staff = True
     staffuser.save()
     User.objects.create_user('normaluser', '[email protected]', 'secret')
开发者ID:ljo,项目名称:META-SHARE,代码行数:17,代码来源:test_view.py


示例18: setUp

 def setUp(self):
     """
     Set up the view
     """
     test_utils.setup_test_storage()
     _fixture = '{0}/repo2/fixtures/testfixture.xml'.format(ROOT_PATH)
     _result = test_utils.import_xml(_fixture)
     self.resource_id = _result[0].id
     resource = resourceInfoType_model.objects.get(pk=self.resource_id)
     self.resource_name = getattr(resource.identificationInfo, 'resourceName', None)
     # set up test users with and without staff permissions.
     # These will live in the test database only, so will not
     # pollute the "normal" development db or the production db.
     # As a consequence, they need no valuable password.
     staffuser = User.objects.create_user('staffuser', '[email protected]',
       'secret')
     staffuser.is_staff = True
     staffuser.save()
     User.objects.create_user('normaluser', '[email protected]', 'secret')
开发者ID:kperi,项目名称:META-SHARE,代码行数:19,代码来源:test_search.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python module.log函数代码示例发布时间:2022-05-27
下一篇:
Python test_utils.set_index_active函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap