Ejemplo n.º 1
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)

        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'
        )
Ejemplo n.º 2
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()
Ejemplo n.º 3
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()
Ejemplo n.º 4
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()
Ejemplo n.º 6
0
 def setup_class(cls):
     CreateTestData.create()
     cls._original_config = config.copy()
     config['ckan.auth.create_user_via_web'] = True
     wsgiapp = ckan.config.middleware.make_app(
         config['global_conf'], **config)
     cls.app = helpers._get_test_app()
     cls.sysadmin_user = model.User.get('testsysadmin')
     PylonsTestCase.setup_class()
Ejemplo n.º 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()
Ejemplo n.º 8
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()
Ejemplo n.º 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)
     SmtpServerHarness.setup_class()
     PylonsTestCase.setup_class()
     umodel.setup()
     ue_model.create_table()
     cls._load_plugins()
     cls.app = hdx_test_base._get_test_app()
Ejemplo n.º 10
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)

        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')
Ejemplo n.º 11
0
 def setup_class(cls):
     PylonsTestCase.setup_class()
     CreateTestData.create()
Ejemplo n.º 12
0
 def setup_class(cls):
     PylonsTestCase.setup_class()
     CreateTestData.create()
Ejemplo n.º 13
0
 def setup_class(cls):
     setup_test_search_index()
     PylonsTestCase.setup_class()
     model.repo.init_db()
     CreateTestData.create()
Ejemplo n.º 14
0
 def setup_class(cls):
     setup_test_search_index()
     PylonsTestCase.setup_class()
     model.repo.init_db()
     CreateTestData.create()