Skip to content

Commit

Permalink
[test_package_search] A couple more tests tag search tests
Browse files Browse the repository at this point in the history
  • Loading branch information
icmurray committed Nov 21, 2011
1 parent cf93d6b commit 98f2a82
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ckan/tests/functional/api/test_package_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,15 @@ def teardown_class(cls):
search.clear()

def test_07_uri_qjson_tags(self):
query = {'q': '', 'tags':['tolstoy']}
json_query = self.dumps(query)
offset = self.base_url + '?qjson=%s' % json_query
res = self.app.get(offset, status=200)
res_dict = self.data_from_res(res)
self.assert_results(res_dict, [u'annakarenina'])
assert res_dict['count'] == 1, res_dict

def test_07_uri_qjson_tags_with_flexible_query(self):
query = {'q': '', 'tags':['Flexible \u30a1']}
json_query = self.dumps(query)
offset = self.base_url + '?qjson=%s' % json_query
Expand Down Expand Up @@ -301,6 +310,13 @@ def test_10_single_tag_with_plus(self):
res_dict = self.data_from_res(res)
assert res_dict['count'] == 2, res_dict

def test_10_multi_tags_with_ampersand_including_a_multiword_tagame(self):
tagname = "Flexible+" + quote(u'\u30a1'.encode('utf8'))
offset = self.base_url + '?tags=tolstoy&tags=%s&all_fields=1' % tagname
res = self.app.get(offset, status=200)
res_dict = self.data_from_res(res)
assert res_dict['count'] == 1, res_dict

def test_10_multiple_tags_with_ampersand(self):
offset = self.base_url + '?tags=tolstoy&tags=russian&all_fields=1'
res = self.app.get(offset, status=200)
Expand Down

0 comments on commit 98f2a82

Please sign in to comment.