Skip to content

Commit

Permalink
[#4462] datastore_search: test q dict form
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Sep 23, 2018
1 parent 8b89b39 commit 522df71
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions ckanext/datastore/tests/test_search.py
Expand Up @@ -1221,14 +1221,28 @@ def test_fields_results_csv(self):
'datastore_search',
resource_id=r['resource_id'],
records_format=u'csv',
fields=u'dt, num, txt',
fields=u'dt',
q=u'aaac',
)
assert_equals(r['fields'], [
{u'id': u'dt', u'type': u'timestamp'},
{u'id': u'num', u'type': u'numeric'},
{u'id': u'txt', u'type': u'text'}])
])
assert_equals(
r['records'],
u'2020-01-01T00:00:00,9,aaac\n'
u'2020-01-01T00:00:00\n'
)
r = helpers.call_action(
'datastore_search',
resource_id=r['resource_id'],
records_format=u'csv',
fields=u'txt, rank txt',
q={u'txt': u'aaac'},
)
assert_equals(r['fields'], [
{u'id': u'txt', u'type': u'text'},
{u'id': u'rank txt', u'type': u'float'},
])
assert_equals(
r['records'][:7],
u'aaac,0.'
)

0 comments on commit 522df71

Please sign in to comment.