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'],