예제 #1
0
    def setup_class(cls):
        smtp_server = config.get('test_smtp_server')
        if smtp_server:
            host, port = smtp_server.split(':')
            port = int(port) + int(
                str(hashlib.md5(cls.__name__).hexdigest())[0], 16)
            config['test_smtp_server'] = '%s:%s' % (host, port)

        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'
        )
예제 #2
0
    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'
        )
예제 #3
0
    def setup_class(cls):
        smtp_server = config.get("test_smtp_server")
        if smtp_server:
            host, port = smtp_server.split(":")
            port = int(port) + int(str(hashlib.md5(cls.__name__).hexdigest())[0], 16)
            config["test_smtp_server"] = "%s:%s" % (host, port)

        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',
        )
예제 #4
0
 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()
예제 #5
0
 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()
 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()
예제 #7
0
 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='*****@*****.**')
     CreateTestData.create_user(name='mary') #NB No email addr provided
     SmtpServerHarness.setup_class()
     PylonsTestCase.setup_class()
예제 #8
0
 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()
예제 #9
0
 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="*****@*****.**")
     CreateTestData.create_user(name="mary")  # NB No email addr provided
     SmtpServerHarness.setup_class()
     PylonsTestCase.setup_class()
예제 #10
0
파일: test_user.py 프로젝트: 1sha1/ckan
 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()
예제 #11
0
 def setup_class(cls):
     smtp_server = config.get('test_smtp_server')
     if smtp_server:
         host, port = smtp_server.split(':')
         port = int(port) + int(
             str(hashlib.md5(cls.__name__).hexdigest())[0], 16)
         config['test_smtp_server'] = '%s:%s' % (host, port)
     CreateTestData.create_user(name='bob', email='*****@*****.**')
     CreateTestData.create_user(name='mary')  #NB No email addr provided
     SmtpServerHarness.setup_class()
     PylonsTestCase.setup_class()
예제 #12
0
파일: test_user.py 프로젝트: gabelula/ckan
    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')
예제 #13
0
    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
예제 #14
0
    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
예제 #15
0
 def setup_class(cls):
     PylonsTestCase.setup_class()
     setup_test_search_index()
     CreateTestData.create()
 def setup_class(cls):
     SmtpServerHarness.setup_class()
     PylonsTestCase.setup_class()
예제 #17
0
 def setup_class(cls):
     PylonsTestCase.setup_class()
     CreateTestData.create()
예제 #18
0
 def setup_class(cls):
     SmtpServerHarness.setup_class()
     PylonsTestCase.setup_class()
예제 #19
0
파일: test_package.py 프로젝트: EnxEng/ckan
 def setup_class(cls):
     PylonsTestCase.setup_class()
     CreateTestData.create()
예제 #20
0
 def setup_class(cls):
     PylonsTestCase.setup_class()
     cls.fixtures = Gov3Fixtures()
     cls.fixtures.create()
예제 #21
0
 def setup_class(cls):
     CreateTestData.create_user(name='bob', email='*****@*****.**')
     CreateTestData.create_user(name='mary') #NB No email addr provided
     SmtpServerHarness.setup_class()
     PylonsTestCase.setup_class()
예제 #22
0
 def setup_class(cls):
     helpers.reset_db()
     PylonsTestCase.setup_class()
     DguCreateTestData.create_dgu_test_data()
예제 #23
0
 def setup_class(cls):
     PylonsTestCase.setup_class()
예제 #24
0
파일: test_home.py 프로젝트: gabelula/ckan
 def setup_class(cls):
     setup_test_search_index()
     PylonsTestCase.setup_class()
     model.repo.init_db()
     CreateTestData.create()
예제 #25
0
파일: test_home.py 프로젝트: AltisCorp/ckan
 def setup_class(cls):
     PylonsTestCase.setup_class()
예제 #26
0
 def setup_class(cls):
     PylonsTestCase.setup_class()
     DguCreateTestData.create_dgu_test_data()
예제 #27
0
 def setup_class(cls):
     PylonsTestCase.setup_class()
     cls.fixtures = Gov3Fixtures()
     cls.fixtures.create()
예제 #28
0
 def setup_class(cls):
     PylonsTestCase.setup_class()
     setup_test_search_index()
     CreateTestData.create()
예제 #29
0
 def setup_class(cls):
     CreateTestData.create_user(name='bob', email='*****@*****.**')
     CreateTestData.create_user(name='mary')  #NB No email addr provided
     SmtpServerHarness.setup_class()
     PylonsTestCase.setup_class()
예제 #30
0
파일: test_home.py 프로젝트: gabelula/ckan
 def setup_class(cls):
     PylonsTestCase.setup_class()
     model.repo.clean_db()
예제 #31
0
 def setup_class(cls):
     PylonsTestCase.setup_class()
     DguCreateTestData.create_dgu_test_data()
예제 #32
0
 def setup_class(cls):
     helpers.reset_db()
     PylonsTestCase.setup_class()
     DguCreateTestData.create_dgu_test_data()
예제 #33
0
파일: test_group.py 프로젝트: pingali/ckan
 def setup_class(self):
     PylonsTestCase.setup_class()
     ckan.tests.CreateTestData.create()
예제 #34
0
 def setup_class(cls):
     PylonsTestCase.setup_class()
     model.repo.init_db()
     CreateTestData.create()
예제 #35
0
 def setup_class(cls):
     setup_test_search_index()
     PylonsTestCase.setup_class()
     model.repo.init_db()
     CreateTestData.create()
예제 #36
0
 def setup_class(cls):
     PylonsTestCase.setup_class()
     model.repo.init_db()
     CreateTestData.create()
예제 #37
0
 def setup_class(cls):
     PylonsTestCase.setup_class()
     model.repo.clean_db()