From a61c497c0484b47f7d205d0cbbfb811b2eb99c98 Mon Sep 17 00:00:00 2001 From: Dominik Moritz Date: Mon, 17 Sep 2012 16:43:06 +0100 Subject: [PATCH] test % in records --- ckanext/datastore/tests/test_datastore.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ckanext/datastore/tests/test_datastore.py b/ckanext/datastore/tests/test_datastore.py index 346a7c44280..263baa17610 100644 --- a/ckanext/datastore/tests/test_datastore.py +++ b/ckanext/datastore/tests/test_datastore.py @@ -666,6 +666,21 @@ def test_upsert_basic(self): assert records[3].author == 'tolkien' model.Session.remove() + # test % in records + data = { + 'resource_id': self.data['resource_id'], + 'method': 'upsert', + 'records': [{'author': 'tol % kien', u'b\xfck': 'the % hobbit'}] + } + + postparams = '%s=1' % json.dumps(data) + auth = {'Authorization': str(self.sysadmin_user.apikey)} + res = self.app.post('/api/action/datastore_upsert', params=postparams, + extra_environ=auth) + res_dict = json.loads(res.body) + + assert res_dict['success'] is True + def test_upsert_missing_key(self): data = { 'resource_id': self.data['resource_id'],