Skip to content

Commit

Permalink
[#262] Fix json for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Feb 20, 2013
1 parent 4b86bb2 commit d39c6c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ckan/tests/__init__.py
Expand Up @@ -32,6 +32,7 @@
from ckan.logic.action import get_domain_object
import ckan.model as model
from ckan import ckan_nose_plugin
from ckan.common import json

# evil hack as url_for is passed out
url_for = h.url_for
Expand All @@ -57,7 +58,7 @@
# webtest (successor library) already has this
# http://pythonpaste.org/webtest/#parsing-the-body
def _getjson(self):
return h.json.loads(self.body)
return json.loads(self.body)
paste.fixture.TestResponse.json = property(_getjson)

# Check config is correct for sqlite
Expand Down Expand Up @@ -455,7 +456,7 @@ def call_action_api(app, action, apikey=None, status=200, **kwargs):
:rtype: dictionary
'''
params = h.json.dumps(kwargs)
params = json.dumps(kwargs)
response = app.post('/api/action/{0}'.format(action), params=params,
extra_environ={'Authorization': str(apikey)}, status=status)
if status in (200,):
Expand Down

0 comments on commit d39c6c3

Please sign in to comment.