Skip to content

Commit

Permalink
test % in records
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz authored and tobes committed Sep 19, 2012
1 parent 295410f commit a61c497
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ckanext/datastore/tests/test_datastore.py
Expand Up @@ -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'],
Expand Down

0 comments on commit a61c497

Please sign in to comment.