Skip to content

Instantly share code, notes, and snippets.

diff --git a/ckan/tests/functional/test_user.py b/ckan/tests/functional/test_user.py
index 4ae63c0..3afc1f2 100644
--- a/ckan/tests/functional/test_user.py
+++ b/ckan/tests/functional/test_user.py
@@ -168,12 +168,14 @@ class TestUserController(FunctionalTestCase, HtmlCheckMethods, PylonsTestCase, S
# first get redirected to user/logged_in
assert_equal(res.status, 302)
- assert res.header('Location').startswith('http://localhost/user/logged_in')
+ assert res.header('Location').startswith('http://localhost/user/logged_in') or \
(pyenv-ckan2)dread@dread-laptop:~/gitroot/ckan2$ nosetests --ckan ckan/tests/test_plugins.py:TestPlugins
/home/dread/gitroot/pyenv-ckan2/lib/python2.6/site-packages/pylons/templating.py:610: UserWarning: Unbuilt egg for setuptools [unknown version] (/usr/lib/python2.6/dist-packages)
Engine = entry_point.load()
No handlers could be found for logger "vdm"
/home/dread/gitroot/pyenv-ckan2/lib/python2.6/site-packages/formalchemy/forms.py:49: SADeprecationWarning: compile_mappers() is renamed to configure_mappers()
compile_mappers() # initializes InstrumentedAttributes
/home/dread/gitroot/pyenv-ckan2/lib/python2.6/site-packages/sqlalchemy/engine/reflection.py:46: SAWarning: Did not recognize type 'BIGINT' of column 'size'
ret = fn(self, con, *args, **kw)
/home/dread/gitroot/pyenv-ckan2/lib/python2.6/site-packages/sqlalchemy/engine/default.py:453: SAWarning: Unicode type received non-unicode bind param value.
param.append(processors[key](compiled_params[key]))
(pyenv-ckan2)dread@dread-laptop:~/gitroot/ckan2$ nosetests --ckan ckan/tests/test_plugins.py:TestPlugins
/home/dread/gitroot/pyenv-ckan2/lib/python2.6/site-packages/pylons/templating.py:610: UserWarning: Unbuilt egg for setuptools [unknown version] (/usr/lib/python2.6/dist-packages)
Engine = entry_point.load()
No handlers could be found for logger "vdm"
/home/dread/gitroot/pyenv-ckan2/lib/python2.6/site-packages/formalchemy/forms.py:49: SADeprecationWarning: compile_mappers() is renamed to configure_mappers()
compile_mappers() # initializes InstrumentedAttributes
/home/dread/gitroot/pyenv-ckan2/lib/python2.6/site-packages/sqlalchemy/engine/reflection.py:46: SAWarning: Did not recognize type 'BIGINT' of column 'size'
ret = fn(self, con, *args, **kw)
/home/dread/gitroot/pyenv-ckan2/lib/python2.6/site-packages/sqlalchemy/engine/default.py:453: SAWarning: Unicode type received non-unicode bind param value.
param.append(processors[key](compiled_params[key]))
diff --git a/ckan/tests/functional/api/model/test_package.py b/ckan/tests/functional/api/model/test_package.py
index eed3e1a..beca564 100644
--- a/ckan/tests/functional/api/model/test_package.py
+++ b/ckan/tests/functional/api/model/test_package.py
@@ -245,6 +245,18 @@ class PackagesTestCase(BaseModelApiTestCase):
res = self.app.post(offset, params=postparams, status=self.STATUS_400_BAD_REQUEST,
extra_environ=self.extra_environ)
+ def test_register_post_bad_request_2(self):
+ test_params = {
@davidread
davidread / ckanext-dgu.diff
Created March 27, 2012 16:25
More Like This in CKAN (DGU extension)
diff --git a/ckanext/dgu/plugin.py b/ckanext/dgu/plugin.py
index 1da26dc..ce1dfbf 100644
--- a/ckanext/dgu/plugin.py
+++ b/ckanext/dgu/plugin.py
@@ -13,6 +13,7 @@ from ckan.plugins import IMiddleware
from ckan.plugins import IAuthFunctions
from ckan.plugins import IPackageController
from ckan.plugins import ISession
+from ckan.plugins import IActions
from ckanext.dgu.middleware import AuthAPIMiddleware
diff --git a/ckan/lib/base.py b/ckan/lib/base.py
index b10c980..0dfe78e 100644
--- a/ckan/lib/base.py
+++ b/ckan/lib/base.py
@@ -193,12 +193,20 @@ class BaseController(WSGIController):
if cookie.startswith('ckan') and cookie not in ['ckan']:
response.delete_cookie(cookie)
# Remove the ckan session cookie if not used e.g. logged out
- elif cookie == 'ckan' and not c.user and not h.are_there_flash_
- if session.id:
diff --git a/ckan/tests/models/test_user.py b/ckan/tests/models/test_user.py
index a49759a..ffd3449 100644
--- a/ckan/tests/models/test_user.py
+++ b/ckan/tests/models/test_user.py
@@ -52,3 +52,50 @@ class TestUser:
out = model.User.get(u'http:/sandra.owndomain.com/')
assert out
assert out.fullname == u'Sandra'
+
+def to_names(domain_obj_list):
@davidread
davidread / README.md
Created June 4, 2014 14:49
data.gov.uk broken links 4/6/14

README is empty

@davidread
davidread / gist:b318ed3c6604384b7f7e
Last active August 29, 2015 14:04
These are the data.gov.uk themes. The INSPIRE themes are mapped to them, according to the "gemet" sections. e.g. under the DGU Theme "Mapping" you see INSPIRE theme "Addresses". The descriptions of the 34 INSPIRE themes are here: http://inspire.ec.europa.eu/index.cfm/pageid/2/list/7
[ {"title": "Crime & Justice",
"description": "Statistics on crimes, policing, justice, courts, prisons, offenders, borders, and immigration.",
},
{"title": "Defence",
"description": "Statistics on the armed forces, Ministry of Defence, workforce, health & safety and search & rescue.",
},
{"title": "Economy & Business",
"description": "Industry and small businesses. Statistics, surveys, economic indicators, import/exports and trade. Excludes government spending transactions & salaries. Excludes household finances",
},
{"title": "Education",
@davidread
davidread / gist:11fafa9d5716766dd053
Created October 2, 2014 16:15
DGU To Go vagrant output
dread@dmbp:~/v-to-go$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'precise64'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...