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


Python pylons_controller.PylonsTestCase类代码示例

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


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

示例1: teardown_class

    def teardown_class(cls):
        config.clear()
        config.update(cls._original_config)
        new_authz.clear_auth_functions_cache()
        PylonsTestCase.teardown_class()

        model.repo.rebuild_db()
开发者ID:1sha1,项目名称:ckan,代码行数:7,代码来源:test_user.py

示例2: setup_class

 def setup_class(cls):
     CreateTestData.create()
     cls._original_config = config.copy()
     wsgiapp = ckan.config.middleware.make_app(
         config['global_conf'], **config)
     cls.app = paste.fixture.TestApp(wsgiapp)
     cls.sysadmin_user = model.User.get('testsysadmin')
     PylonsTestCase.setup_class()
开发者ID:EnxEng,项目名称:ckan,代码行数:8,代码来源:test_user.py

示例3: setup_class

 def setup_class(cls):
     smtp_server = config.get('smtp.test_server')
     if smtp_server:
         host, port = smtp_server.split(':')
         port = int(port) + int(str(hashlib.md5(cls.__name__).hexdigest())[0], 16)
         config['smtp.test_server'] = '%s:%s' % (host, port)
     SmtpServerHarness.setup_class()
     PylonsTestCase.setup_class()
开发者ID:1sha1,项目名称:ckan,代码行数:8,代码来源:test_mock_mail_server.py

示例4: setup_class

 def setup_class(cls):
     CreateTestData.create()
     cls._original_config = config.copy()
     config['ckan.auth.create_user_via_web'] = True
     new_authz.clear_auth_functions_cache()
     wsgiapp = ckan.config.middleware.make_app(
         config['global_conf'], **config)
     cls.app = paste.fixture.TestApp(wsgiapp)
     cls.sysadmin_user = model.User.get('testsysadmin')
     PylonsTestCase.setup_class()
开发者ID:1sha1,项目名称:ckan,代码行数:10,代码来源:test_user.py

示例5: setup_class

 def setup_class(cls):
     smtp_server = config.get("smtp.test_server")
     if smtp_server:
         host, port = smtp_server.split(":")
         port = int(port) + int(str(hashlib.md5(cls.__name__).hexdigest())[0], 16)
         config["smtp.test_server"] = "%s:%s" % (host, port)
     CreateTestData.create_user(name="bob", email="[email protected]")
     CreateTestData.create_user(name="mary")  # NB No email addr provided
     SmtpServerHarness.setup_class()
     PylonsTestCase.setup_class()
开发者ID:BigOpenData,项目名称:ckan,代码行数:10,代码来源:test_mailer.py

示例6: setup_class

 def setup_class(cls):
     smtp_server = config.get('smtp.test_server')
     if smtp_server:
         host, port = smtp_server.split(':')
         port = int(port) + int(str(hashlib.md5(cls.__name__).hexdigest())[0], 16)
         config['smtp.test_server'] = '%s:%s' % (host, port)
     CreateTestData.create_user(name='bob', email='[email protected]')
     CreateTestData.create_user(name='mary') #NB No email addr provided
     SmtpServerHarness.setup_class()
     PylonsTestCase.setup_class()
开发者ID:31H0B1eV,项目名称:ckan,代码行数:10,代码来源:test_mailer.py

示例7: setup_class

    def setup_class(self):
        PylonsTestCase.setup_class()
        SmtpServerHarness.setup_class()
        CreateTestData.create()

        # make 3 changes, authored by annafan
        for i in range(3):
            rev = model.repo.new_revision()
            pkg = model.Package.by_name(u'annakarenina')
            pkg.notes = u'Changed notes %i' % i
            rev.author = u'annafan'
            model.repo.commit_and_remove()

        CreateTestData.create_user('unfinisher', about='<a href="http://unfinished.tag')
        CreateTestData.create_user('uncloser', about='<a href="http://unclosed.tag">')
        CreateTestData.create_user('spammer', about=u'<a href="http://mysite">mysite</a> <a href=\u201dhttp://test2\u201d>test2</a>')
        CreateTestData.create_user('spammer2', about=u'<a href="http://spamsite1.com\u201d>spamsite1</a>\r\n<a href="http://www.spamsite2.com\u201d>spamsite2</a>\r\n')
开发者ID:gabelula,项目名称:ckan,代码行数:17,代码来源:test_user.py

示例8: setup_class

    def setup_class(cls):
        PylonsTestCase.setup_class()
        HarvestFixture.setup_class()

        # prepare to render package page
        user = model.PSEUDO_USER__VISITOR
        c.pkg = model.Package.by_name(u'annakarenina')
        c.locale = 'en'
        c.body_class = 'hide-sidebar'
        c.controller = 'package'
        c.action = 'read'
        c.user = user
        c.is_preview = False
        c.hide_welcome_message = False
        context = {'model': model, 'session': model.Session,
                   'user': c.user,
                   'package':c.pkg}
        c.pkg_dict = get_action('package_show')(context, {'id':c.pkg.id})

        # inject a mock-routes_dict into the environ in order
        # that the template can be rendered correctly.
        # See 'ckan/templates/layout_base.html'
        # (This is also fixed in ckan 1.5.1)
        import pylons
        pylons.request.environ.update({'pylons.routes_dict': {
            'action': 'test-action',
            'controller': 'test-package::',
        }})

        # Render package view page
        # (filter should not be called on this occasion)
        PackageSaver().render_package(c.pkg_dict,
                                      context)
        cls.pkg_page = render('package/read.html')

        # Expected URLs
        harvest_object_id = c.pkg.extras.get('harvest_object_id')
        cls.harvest_xml_url = '/api/2/rest/harvestobject/%s/xml' % harvest_object_id
        cls.harvest_html_url = '/api/2/rest/harvestobject/%s/html' % harvest_object_id
开发者ID:icmurray,项目名称:ckanext-dgu,代码行数:39,代码来源:test_filters.py

示例9: setup_class

 def setup_class(cls):
     PylonsTestCase.setup_class()
开发者ID:AltisCorp,项目名称:ckan,代码行数:2,代码来源:test_home.py

示例10: setup_class

 def setup_class(cls):
     PylonsTestCase.setup_class()
     DguCreateTestData.create_dgu_test_data()
开发者ID:heinlja,项目名称:ckanext-dgu-old,代码行数:3,代码来源:test_helpers.py

示例11: setup_class

 def setup_class(cls):
     helpers.reset_db()
     PylonsTestCase.setup_class()
     DguCreateTestData.create_dgu_test_data()
开发者ID:datagovuk,项目名称:ckanext-dgu,代码行数:4,代码来源:test_helpers.py

示例12: setup_class

 def setup_class(cls):
     PylonsTestCase.setup_class()
     setup_test_search_index()
     CreateTestData.create()
开发者ID:kindly,项目名称:ckantest,代码行数:4,代码来源:test_search.py

示例13: teardown_class

    def teardown_class(cls):
        config.clear()
        config.update(cls._original_config)
        PylonsTestCase.teardown_class()

        model.repo.rebuild_db()
开发者ID:EnxEng,项目名称:ckan,代码行数:6,代码来源:test_user.py

示例14: setup_class

 def setup_class(cls):
     setup_test_search_index()
     PylonsTestCase.setup_class()
     model.repo.init_db()
     CreateTestData.create()
开发者ID:gabelula,项目名称:ckan,代码行数:5,代码来源:test_home.py

示例15: setup_class

 def setup_class(self):
     PylonsTestCase.setup_class()
     ckan.tests.CreateTestData.create()
开发者ID:AdamJensen-dk,项目名称:ckan-drupal,代码行数:3,代码来源:test_group.py


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