[ckan-changes] commit/ckan: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Wed Jul 20 10:41:18 UTC 2011
2 new changesets in ckan:
http://bitbucket.org/okfn/ckan/changeset/8531b9fc1ee2/
changeset: 8531b9fc1ee2
user: kindly
date: 2011-07-19 20:45:57
summary: [tests] ticket 1230 make sure configure is run before all tests
affected #: 1 file (447 bytes)
--- a/ckan/ckan_nose_plugin.py Sun Jul 10 22:58:18 2011 +0100
+++ b/ckan/ckan_nose_plugin.py Tue Jul 19 19:45:57 2011 +0100
@@ -4,8 +4,7 @@
import sys
import pkg_resources
from paste.deploy import loadapp
-
-pylonsapp = None
+from pylons import config
class CkanNose(Plugin):
settings = None
@@ -29,6 +28,15 @@
# the db is destroyed after every test when you Session.Remove().
model.repo.init_db()
+ ## This is to make sure the configuration is run again.
+ ## Plugins use configure to make their own tables and they
+ ## may need to be recreated to make tests work.
+ from ckan.plugins import PluginImplementations
+ from ckan.plugins.interfaces import IConfigurable
+ for plugin in PluginImplementations(IConfigurable):
+ plugin.configure(config)
+
+
def options(self, parser, env):
parser.add_option(
'--ckan',
http://bitbucket.org/okfn/ckan/changeset/1e2f659ec719/
changeset: 1e2f659ec719
user: kindly
date: 2011-07-19 20:46:35
summary: [merge] default
affected #: 1 file (18 bytes)
--- a/fabfile.py Tue Jul 19 19:45:57 2011 +0100
+++ b/fabfile.py Tue Jul 19 19:46:35 2011 +0100
@@ -167,7 +167,7 @@
db_user=None,
db_pass='',
db_host='localhost',
- user=None
+ user='okfn'
):
'''Configurable configuration: fab -d gives full info.
@@ -401,7 +401,7 @@
with cd(env.instance_path):
assert exists(env.config_ini_filename), "Can't find config file: %s/%s" % (env.instance_path, env.config_ini_filename)
db_details = _get_db_config()
- assert db_details['db_type'] == 'postgres'
+ assert db_details['db_type'] in ('postgres', 'postgresql')
port_option = '-p %s' % db_details['db_port'] if db_details['db_port'] else ''
run('export PGPASSWORD=%s&&pg_dump -U %s -h %s %s %s > %s' % (db_details['db_pass'], db_details['db_user'], db_details['db_host'], port_option, db_details['db_name'], pg_dump_filepath), shell=False)
assert exists(pg_dump_filepath)
Repository URL: https://bitbucket.org/okfn/ckan/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the ckan-changes
mailing list