def setup_class(cls): config = appconfig('config:test.ini', relative_to=conf_dir) config.local_conf['ckan.plugins'] = 'todo' wsgiapp = make_app(config.global_conf, **config.local_conf) cls.app = paste.fixture.TestApp(wsgiapp) CreateTestData.create() CreateTodoTestData.create()
def setup_class(self): 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' )
def setup(self): model.Session.remove() CreateTestData.create(auth_profile='publisher') self.sysadmin_user = model.User.get('testsysadmin') self.normal_user = model.User.get( 'annafan') # Does not belong to a publisher self.publisher1_user = model.User.by_name('russianfan') self.publisher2_user = model.User.by_name('tester') # Create two Publishers rev = model.repo.new_revision() self.publisher1 = model.Group(name=u'test-publisher1', title=u'Test Publihser 1', type=u'publisher') Session.add(self.publisher1) self.publisher2 = model.Group(name=u'test-publisher2', title=u'Test Publihser 2', type=u'publisher') Session.add(self.publisher2) member1 = model.Member(table_name='user', table_id=self.publisher1_user.id, group=self.publisher1, capacity='admin') Session.add(member1) member2 = model.Member(table_name='user', table_id=self.publisher2_user.id, group=self.publisher2, capacity='admin') Session.add(member2) Session.commit()
def setup_class(cls): """ Remove any initial sessions. """ Session.remove() # TODO: Should also remove test data CreateTestData.create()
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', )
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' )
def setup(self): model.Session.remove() CreateTestData.create(auth_profile='publisher') self.sysadmin_user = model.User.get('testsysadmin') self.normal_user = model.User.get('annafan') # Does not belong to a publisher self.publisher1_user = model.User.by_name('russianfan') self.publisher2_user = model.User.by_name('tester') # Create two Publishers rev = model.repo.new_revision() self.publisher1 = model.Group(name=u'test-publisher1',title=u'Test Publihser 1',type=u'publisher') Session.add(self.publisher1) self.publisher2 = model.Group(name=u'test-publisher2',title=u'Test Publihser 2',type=u'publisher') Session.add(self.publisher2) member1 = model.Member(table_name = 'user', table_id = self.publisher1_user.id, group=self.publisher1, capacity='admin') Session.add(member1) member2 = model.Member(table_name = 'user', table_id = self.publisher2_user.id, group=self.publisher2, capacity='admin') Session.add(member2) Session.commit()
def setup_class(self): model.Session.remove() CreateTestData.create() self.name = u'revisiontest' # create pkg self.descriptions = [ u'Written by Puccini', u'Written by Rossini', u'Not written at all', u'Written again', u'Written off' ] rev = model.repo.new_revision() self.grp = model.Group(name=self.name) model.Session.add(self.grp) self.grp.description = self.descriptions[0] self.grp.extras['mykey'] = self.descriptions[0] model.repo.commit_and_remove() # edit pkg for i in range(5)[1:]: rev = model.repo.new_revision() grp = model.Group.by_name(self.name) grp.description = self.descriptions[i] grp.extras['mykey'] = self.descriptions[i] model.repo.commit_and_remove() self.grp = model.Group.by_name(self.name)
def setup_class(cls): setup_test_search_index() # Force a garbage collection to trigger issue #695 import gc gc.collect() CreateTestData.create() cls.new_pkg_dict = { 'name': 'council-owned-litter-bins', 'notes': 'Location of Council owned litter bins within Borough.', 'resources': [{ 'description': 'Resource locator', 'format': 'Unverified', 'url': 'http://www.barrowbc.gov.uk' }], 'tags': ['Utility and governmental services'], 'title': 'Council Owned Litter Bins', 'extras': { 'INSPIRE': 'True', 'bbox-east-long': '-3.12442', 'bbox-north-lat': '54.218407', 'bbox-south-lat': '54.039634', 'bbox-west-long': '-3.32485', 'constraint': 'conditions unknown; (e) intellectual property rights;', 'dataset-reference-date': [{ 'type': 'creation', 'value': '2008-10-10' }, { 'type': 'revision', 'value': '2009-10-08' }], 'guid': '00a743bf-cca4-4c19-a8e5-e64f7edbcadd', 'metadata-date': '2009-10-16', 'metadata-language': 'eng', 'published_by': 0, 'resource-type': 'dataset', 'spatial-reference-system': 'test-spatial', 'temporal_coverage-from': '1977-03-10T11:45:30', 'temporal_coverage-to': '2005-01-15T09:10:00' } }
def setup_class(self): """ Remove any initial sessions. """ Session.remove() # TODO: Should also remove test data CreateTestData.create() self.sysadmin = model.User.get('testsysadmin')
def setup_class(cls): config = appconfig('config:test.ini', relative_to=conf_dir) config.local_conf['ckan.storage.directory'] = '/tmp/' wsgiapp = make_app(config.global_conf, **config.local_conf) cls.app = paste.fixture.TestApp(wsgiapp) CreateTestData.create() model.Session.remove() user = model.User.by_name('tester') cls.extra_environ = {'Authorization': str(user.apikey)}
def setup_class(cls): """ Remove any initial sessions. """ Session.remove() CreateTestData.create() url = url_for(controller="ckanext.sitemap.controller:SitemapController", action="view") cls.cont = cls.app.get(url) cls.content_file = StringIO(cls.cont.body)
def setup_class(cls): config = appconfig('config:test.ini', relative_to=conf_dir) config.local_conf['ckan.plugins'] = 'wordpresser' config.local_conf['wordpresser.proxy_host'] \ = 'http://localhost:6969/' wsgiapp = make_app(config.global_conf, **config.local_conf) env = {'HTTP_ACCEPT': 'text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'} cls.app = paste.fixture.TestApp(wsgiapp, extra_environ=env) CreateTestData.create() runmockserver()
def setup_class(cls): """ Remove any initial sessions. """ Session.remove() CreateTestData.create() url = url_for( controller="ckanext.sitemap.controller:SitemapController", action='view') cls.cont = cls.app.get(url) cls.content_file = StringIO(cls.cont.body)
def setup_class(self): model.repo.init_db() model.repo.rebuild_db() model.repo.init_db() 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()
def setup_class(cls): InitDB("initdb").run([]) # set up database tables config = appconfig('config:test.ini', relative_to=conf_dir) config.local_conf['ckan.plugins'] = 'googleanalytics' config.local_conf['googleanalytics.id'] = 'UA-borf-1' config.local_conf['googleanalytics.show_downloads'] = 'true' cls.config = config.local_conf wsgiapp = make_app(config.global_conf, **config.local_conf) env = {'HTTP_ACCEPT': ('text/html;q=0.9,text/plain;' 'q=0.8,image/png,*/*;q=0.5')} cls.app = paste.fixture.TestApp(wsgiapp, extra_environ=env) CreateTestData.create() runmockserver()
def setup_class(cls): config = appconfig('config:test.ini', relative_to=conf_dir) for key in config.local_conf.keys(): if key.startswith('ofs'): del config.local_conf[key] config.local_conf['ckan.storage.bucket'] = 'ckantest' config.local_conf['ofs.impl'] = 'pairtree' config.local_conf['ofs.storage_dir'] = '/tmp/ckan-test-ckanext-storage' wsgiapp = make_app(config.global_conf, **config.local_conf) cls.app = paste.fixture.TestApp(wsgiapp) CreateTestData.create() model.Session.remove() user = model.User.by_name('tester') cls.extra_environ = {'Authorization': str(user.apikey)}
def setup_class(self): 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')
def setup_class(cls): cls._original_config = config.copy() for key in config.keys(): if key.startswith('ofs'): del config[key] config['ckan.storage.bucket'] = 'ckantest' config['ofs.impl'] = 'pairtree' config['ofs.storage_dir'] = '/tmp/ckan-test-ckanext-storage' create_pairtree_marker( config['ofs.storage_dir'] ) wsgiapp = make_app(config['global_conf'], **config) cls.app = paste.fixture.TestApp(wsgiapp) CreateTestData.create() model.Session.remove() user = model.User.by_name('tester') cls.extra_environ = {'Authorization': str(user.apikey)}
def setup_class(cls): config = appconfig('config:test.ini', relative_to=conf_dir) for key in config.local_conf.keys(): if key.startswith('ofs'): del config.local_conf[key] config.local_conf['ckan.storage.bucket'] = 'ckantest' config.local_conf['ofs.impl'] = 'pairtree' config.local_conf['ofs.storage_dir'] = '/tmp/ckan-test-ckanext-storage' create_pairtree_marker( config.local_conf['ofs.storage_dir'] ) wsgiapp = make_app(config.global_conf, **config.local_conf) cls.app = paste.fixture.TestApp(wsgiapp) CreateTestData.create() model.Session.remove() user = model.User.by_name('tester') cls.extra_environ = {'Authorization': str(user.apikey)}
def setup_class(cls): # setup test data including testsysadmin user CreateTestData.create() # Creating a couple of authorization groups, which are enough to break # some things just by their existence for ag_name in [u'anauthzgroup', u'anotherauthzgroup']: ag=model.AuthorizationGroup.by_name(ag_name) if not ag: #may already exist, if not create ag=model.AuthorizationGroup(name=ag_name) model.Session.add(ag) model.Session.commit() #they are especially dangerous if they have a role on the System ag = model.AuthorizationGroup.by_name(u'anauthzgroup') model.add_authorization_group_to_role(ag, u'editor', model.System()) model.Session.commit()
def setup_class(self): super(TestActionPackageSearch,self).setup_class() setup_test_search_index() self.package_fixture_data_1 = { 'name' : u'test-spatial-dataset-search-point-1', 'title': 'Some Title 1', 'extras': [{'key':'spatial','value':self.geojson_examples['point']}] } self.package_fixture_data_2 = { 'name' : u'test-spatial-dataset-search-point-2', 'title': 'Some Title 2', 'extras': [{'key':'spatial','value':self.geojson_examples['point_2']}] } CreateTestData.create()
class TestDatastoreController(TestController): @classmethod def setup_class(cls): # Check if Elastic Search is available, otherwise skip tests try: res = requests.get('http://%s/_status' % ELASTIC_SEARCH_HOST, timeout=2) if res.status_code == 200: try: content = json.loads(res.content) if not 'ok' in content or not '_shards' in content: raise ValueError except ValueError: raise SkipTest( 'This does not look like Elastic Search, skipping...') else: raise SkipTest('Could not reach Elastic Search, skipping...') except (requests.exceptions.RequestException, socket.timeout), e: raise SkipTest('Could not reach Elastic Search, skipping... (%r)' % e) # Push dummy data to create the test index requests.put('http://%s/ckan-%s/' % (ELASTIC_SEARCH_HOST, config.get('ckan.site_id'))) model.repo.init_db() CreateTestData.create()
def setup_class(cls): """ Remove any initial sessions. """ Session.remove() cls.original_config = config.copy() plugins = set(config['ckan.plugins'].strip().split()) plugins.add('sitemap') config['ckan.plugins'] = ' '.join(plugins) cls.app = _get_test_app() CreateTestData.create() url = url_for( controller="ckanext.sitemap.controller:SitemapController", action='view') cls.cont = cls.app.get(url) cls.content_file = StringIO(cls.cont.body)
def setup_class(cls): InitDB("initdb").run([]) # set up database tables config = appconfig('config:test.ini', relative_to=conf_dir) config.local_conf['ckan.plugins'] = 'googleanalytics' config.local_conf['googleanalytics.id'] = 'UA-borf-1' config.local_conf['googleanalytics.show_downloads'] = 'true' cls.config = config.local_conf wsgiapp = make_app(config.global_conf, **config.local_conf) env = { 'HTTP_ACCEPT': ('text/html;q=0.9,text/plain;' 'q=0.8,image/png,*/*;q=0.5') } cls.app = paste.fixture.TestApp(wsgiapp, extra_environ=env) CreateTestData.create() runmockserver()
def setup_class(cls): config = appconfig('config:test.ini', relative_to=conf_dir) wsgiapp = make_app(config.global_conf, **config.local_conf) cls.app = paste.fixture.TestApp(wsgiapp) # setup test data including testsysadmin user CreateTestData.create() # Creating a couple of authorization groups, which are enough to break # some things just by their existence for ag_name in [u'anauthzgroup', u'anotherauthzgroup']: ag=model.AuthorizationGroup.by_name(ag_name) if not ag: #may already exist, if not create ag=model.AuthorizationGroup(name=ag_name) model.Session.add(ag) model.Session.commit() #they are especially dangerous if they have a role on the System ag = model.AuthorizationGroup.by_name(u'anauthzgroup') model.add_authorization_group_to_role(ag, u'editor', model.System()) model.Session.commit()
def setup_class(self): setup_test_search_index() CreateTestData.create() self.non_active_name = u'test_nonactive' pkg = model.Package(name=self.non_active_name) model.repo.new_revision() model.Session.add(pkg) model.repo.commit_and_remove() pkg = model.Session.query(model.Package).filter_by(name=self.non_active_name).one() admin = model.User.by_name(u'joeadmin') model.setup_default_user_roles(pkg, [admin]) model.repo.commit_and_remove() model.repo.new_revision() pkg = model.Session.query(model.Package).filter_by(name=self.non_active_name).one() pkg.delete() # becomes non active model.repo.commit_and_remove()
def setup_class(cls): InitDB("initdb").run([]) # set up database tables config = appconfig("config:test.ini", relative_to=conf_dir) config.local_conf["ckan.plugins"] = "googleanalytics" config.local_conf["googleanalytics.username"] = "******" config.local_conf["googleanalytics.password"] = "******" config.local_conf["googleanalytics.id"] = "UA-borf-1" config.local_conf["googleanalytics.show_downloads"] = "true" cls.config = config.local_conf wsgiapp = make_app(config.global_conf, **config.local_conf) env = { "HTTP_ACCEPT": ("text/html;q=0.9,text/plain;" "q=0.8,image/png,*/*;q=0.5") } cls.app = paste.fixture.TestApp(wsgiapp, extra_environ=env) CreateTestData.create() runmockserver()
def setup_class(cls): config = appconfig('config:test.ini', relative_to=conf_dir) config.local_conf['ckan.storage.bucket'] = 'ckantest' config.local_conf['ofs.impl'] = 'google' if 'ofs.gs_secret_access_key' not in config.local_conf: raise Exception('You will need to configure access to google storage to run this test') # You will need these configured in your # config.local_conf['ofs.gs_access_key_id'] = 'GOOGCABCDASDASD' # config.local_conf['ofs.gs_secret_access_key'] = '134zsdfjkw4234addad' # need to ensure not configured for local as breaks google setup # (and cannot delete all ofs keys as need the gs access codes) if 'ofs.storage_dir' in config.local_conf: del config.local_conf['ofs.storage_dir'] wsgiapp = make_app(config.global_conf, **config.local_conf) cls.app = paste.fixture.TestApp(wsgiapp) # setup test data including testsysadmin user CreateTestData.create() model.Session.remove() user = model.User.by_name('tester') cls.extra_environ = {'Authorization': str(user.apikey)}
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', )
def setup_class(self): model.Session.remove() CreateTestData.create() self.name = u'revisiontest' # create pkg self.descriptions = [u'Written by Puccini', u'Written by Rossini', u'Not written at all', u'Written again', u'Written off'] rev = model.repo.new_revision() self.grp = model.Group(name=self.name) model.Session.add(self.grp) self.grp.description = self.descriptions[0] self.grp.extras['mykey'] = self.descriptions[0] model.repo.commit_and_remove() # edit pkg for i in range(5)[1:]: rev = model.repo.new_revision() grp = model.Group.by_name(self.name) grp.description = self.descriptions[i] grp.extras['mykey'] = self.descriptions[i] model.repo.commit_and_remove() self.grp = model.Group.by_name(self.name)
def setup_class(self): super(TestActionPackageSearch, self).setup_class() setup_test_search_index() self.package_fixture_data_1 = { 'name': u'test-spatial-dataset-search-point-1', 'title': 'Some Title 1', 'extras': [{ 'key': 'spatial', 'value': self.geojson_examples['point'] }] } self.package_fixture_data_2 = { 'name': u'test-spatial-dataset-search-point-2', 'title': 'Some Title 2', 'extras': [{ 'key': 'spatial', 'value': self.geojson_examples['point_2'] }] } CreateTestData.create()
def setup_class(cls): setup_test_search_index() # Force a garbage collection to trigger issue #695 import gc gc.collect() CreateTestData.create() cls.new_pkg_dict = { 'name': 'council-owned-litter-bins', 'notes': 'Location of Council owned litter bins within Borough.', 'resources': [{'description': 'Resource locator', 'format': 'Unverified', 'url': 'http://www.barrowbc.gov.uk'}], 'tags': ['Utility and governmental services'], 'title': 'Council Owned Litter Bins', 'extras': { 'INSPIRE': 'True', 'bbox-east-long': '-3.12442', 'bbox-north-lat': '54.218407', 'bbox-south-lat': '54.039634', 'bbox-west-long': '-3.32485', 'constraint': 'conditions unknown; (e) intellectual property rights;', 'dataset-reference-date': [{'type': 'creation', 'value': '2008-10-10'}, {'type': 'revision', 'value': '2009-10-08'}], 'guid': '00a743bf-cca4-4c19-a8e5-e64f7edbcadd', 'metadata-date': '2009-10-16', 'metadata-language': 'eng', 'published_by': 0, 'resource-type': 'dataset', 'spatial-reference-system': 'test-spatial', 'temporal_coverage-from': '1977-03-10T11:45:30', 'temporal_coverage-to': '2005-01-15T09:10:00' } }
def setup_class(cls): setup_test_search_index() # Force a garbage collection to trigger issue #695 import gc gc.collect() CreateTestData.create() cls.new_pkg_dict = { "name": "council-owned-litter-bins", "notes": "Location of Council owned litter bins within Borough.", "resources": [{"description": "Resource locator", "format": "Unverified", "url": "http://www.barrowbc.gov.uk"}], "tags": ["Utility and governmental services"], "title": "Council Owned Litter Bins", "extras": { "INSPIRE": "True", "bbox-east-long": "-3.12442", "bbox-north-lat": "54.218407", "bbox-south-lat": "54.039634", "bbox-west-long": "-3.32485", "constraint": "conditions unknown; (e) intellectual property rights;", "dataset-reference-date": [{"type": "creation", "value": "2008-10-10"}, {"type": "revision", "value": "2009-10-08"}], "guid": "00a743bf-cca4-4c19-a8e5-e64f7edbcadd", "metadata-date": "2009-10-16", "metadata-language": "eng", "published_by": 0, "resource-type": "dataset", "spatial-reference-system": "wee", "temporal_coverage-from": "1977-03-10T11:45:30", "temporal_coverage-to": "2005-01-15T09:10:00" } }
def test_map_shown(self): CreateTestData.create() extra_environ = {'REMOTE_USER': '******'} name = 'annakarenina' offset = url_for(controller='package', action='edit', id=name) res = self.app.get(offset, extra_environ=extra_environ) assert 'Edit - Datasets' in res fv = res.forms['dataset-edit'] prefix = '' fv[prefix + 'extras__1__key'] = u'spatial' fv[prefix + 'extras__1__value'] = self.geojson_examples['point'] res = fv.submit('save', extra_environ=extra_environ) assert not 'Error' in res, res # Load the dataset page and check if the libraries have been loaded offset = url_for(controller='package', action='read', id=name) res = self.app.get(offset) assert '<div class="dataset-map subsection">' in res, res assert '<script type="text/javascript" src="/ckanext/spatial/js/dataset_map.js"></script>' in res assert self.geojson_examples['point'] in res
def test_map_shown(self): CreateTestData.create() extra_environ = {"REMOTE_USER": "******"} name = "annakarenina" offset = url_for(controller="package", action="edit", id=name) res = self.app.get(offset, extra_environ=extra_environ) assert "Edit - Datasets" in res fv = res.forms["dataset-edit"] prefix = "" fv[prefix + "extras__1__key"] = u"spatial" fv[prefix + "extras__1__value"] = self.geojson_examples["point"] res = fv.submit("save", extra_environ=extra_environ) assert not "Error" in res, res # Load the dataset page and check if the libraries have been loaded offset = url_for(controller="package", action="read", id=name) res = self.app.get(offset) assert '<div class="dataset-map subsection">' in res, res assert '<script type="text/javascript" src="/ckanext/spatial/js/dataset_map.js"></script>' in res assert self.geojson_examples["point"] in res
def setup_class(cls): cls._original_config = config.copy() config['ckan.storage.directory'] = '/tmp' wsgiapp = make_app(config['global_conf'], **config) cls.app = paste.fixture.TestApp(wsgiapp) CreateTestData.create()
def setup(cls): config = appconfig('config:test.ini', relative_to=conf_dir) wsgiapp = make_app(config.global_conf, **config.local_conf) cls.app = paste.fixture.TestApp(wsgiapp) CreateTestData.create()
def setup_class(cls): config = appconfig('config:test.ini', relative_to=conf_dir) wsgiapp = make_app(config.global_conf, **config.local_conf) cls.app = paste.fixture.TestApp(wsgiapp) # setup test data including testsysadmin user CreateTestData.create()
def setup_class(cls): setup_test_search_index() CreateTestData.create() cls.solr = search.make_connection() cls.fq = " +site_id:\"%s\" " % config['ckan.site_id']
def setup_class(cls): # setup test data including testsysadmin user CreateTestData.create()
def setup_class(cls): setup_test_search_index() CreateTestData.create()
def setup(self): CreateTestData.create()
def setup_class(cls): PylonsTestCase.setup_class() setup_test_search_index() CreateTestData.create()
def setup_class(cls): # setup test data including testsysadmin user CreateTestData.create() model.Session.commit()
def setup(self): CreateTestData.create() self.sysadmin_user = model.User.get('testsysadmin') self.normal_user = model.User.get('annafan')
def setup(cls): CreateTestData.create()
def setup_class(cls): config = appconfig('config:test.ini', relative_to=conf_dir) config.local_conf['ckan.plugins'] = 'follower' wsgiapp = make_app(config.global_conf, **config.local_conf) cls.app = paste.fixture.TestApp(wsgiapp) CreateTestData.create()
def setup_class(self): model.Session.remove() # rebuild db before this test as it depends delicately on what # revisions exist model.repo.init_db() CreateTestData.create()
def setup_class(cls): config = appconfig('config:test.ini', relative_to=conf_dir) config.local_conf['ckan.storage.directory'] = '/tmp' wsgiapp = make_app(config.global_conf, **config.local_conf) cls.app = paste.fixture.TestApp(wsgiapp) CreateTestData.create()