Skip to content

Commit

Permalink
add test case for package_search() 'fl' support
Browse files Browse the repository at this point in the history
  • Loading branch information
fanjinfei committed Feb 8, 2017
1 parent 3fdb4c1 commit 870aff9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ckan/tests/logic/action/test_get.py
Expand Up @@ -852,6 +852,17 @@ def test_search(self):
eq(search_result['results'][0]['title'], 'Rivers')
eq(search_result['count'], 1)

def test_search_fl(self):
factories.Dataset(title='Rivers', name='test_ri')
factories.Dataset(title='Lakes')

search_result = helpers.call_action('package_search', q='rivers', fl=['title', 'name'])

eq(search_result['results'][0]['title'], 'Rivers')
eq(search_result['results'][0]['name'], 'test_ri')
eq(len(search_result['results'][0]), 2)
eq(search_result['count'], 1)

def test_search_all(self):
factories.Dataset(title='Rivers')
factories.Dataset(title='Lakes')
Expand Down

0 comments on commit 870aff9

Please sign in to comment.