Skip to content

Commit

Permalink
[#818] Try order by id to prevent test fail
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes authored and amercader committed Aug 19, 2014
1 parent 6568761 commit e8a3cb4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ckan/tests/lib/test_resource_search.py
Expand Up @@ -136,15 +136,15 @@ def test_12_search_all_fields(self):

def test_13_pagination(self):
# large search
options = search.QueryOptions(order_by='hash')
options = search.QueryOptions(order_by='id')
fields = {'url':'site'}
all_results = search.query_for(model.Resource).run(fields=fields, options=options)
all_resources = all_results['results']
all_resource_count = all_results['count']
assert all_resource_count >= 6, all_results

# limit
options = search.QueryOptions(order_by='hash')
options = search.QueryOptions(order_by='id')
options.limit = 2
result = search.query_for(model.Resource).run(fields=fields, options=options)
resources = result['results']
Expand All @@ -154,7 +154,7 @@ def test_13_pagination(self):
assert resources == all_resources[:2], '%r, %r' % (resources, all_resources)

# offset
options = search.QueryOptions(order_by='hash')
options = search.QueryOptions(order_by='id')
options.limit = 2
options.offset = 2
result = search.query_for(model.Resource).run(fields=fields, options=options)
Expand All @@ -163,7 +163,7 @@ def test_13_pagination(self):
assert resources == all_resources[2:4]

# larger offset
options = search.QueryOptions(order_by='hash')
options = search.QueryOptions(order_by='id')
options.limit = 2
options.offset = 4
result = search.query_for(model.Resource).run(fields=fields, options=options)
Expand Down

0 comments on commit e8a3cb4

Please sign in to comment.