Skip to content

Commit

Permalink
[#2438] Test resource_search works with a GET request
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Murray committed Jun 26, 2012
1 parent afd7ee0 commit 521273b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ckan/tests/logic/test_action.py
Expand Up @@ -1094,6 +1094,21 @@ def test_42_resource_search_fields_parameter_still_accepted(self):
for resource in result:
assert "index" in resource['description'].lower()

def test_42_resource_search_accessible_via_get_request(self):
response = self.app.get('/api/action/resource_search'
'?query=description:index&query=format:json')

result = json.loads(response.body)['result']['results']
count = json.loads(response.body)['result']['count']

## Due to the side-effect of previously run tests, there may be extra
## resources in the results. So just check that each found Resource
## matches the search criteria
assert count > 0
for resource in result:
assert "index" in resource['description'].lower()
assert "json" in resource['format'].lower()

class TestActionTermTranslation(WsgiAppCase):

@classmethod
Expand Down

0 comments on commit 521273b

Please sign in to comment.