Skip to content

Commit

Permalink
[#3055] Fix fragile legacy test
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed May 25, 2016
1 parent 1df9543 commit a89ce5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ckan/lib/helpers.py
Expand Up @@ -1037,7 +1037,7 @@ def pager_url(page, partial=None, **kwargs):
if routes_dict.get('id'):
kwargs['id'] = routes_dict['id']
kwargs['page'] = page
return url(**kwargs)
return url_for(**kwargs)


class Page(paginate.Page):
Expand Down
4 changes: 2 additions & 2 deletions ckan/tests/legacy/functional/test_pagination.py
Expand Up @@ -100,12 +100,12 @@ def teardown_class(self):

def test_group_index(self):
res = self.app.get(url_for(controller='group', action='index'))
assert 'href="/group?sort=&q=&page=2"' in res, res
assert 'href="/group?q=&sort=&page=2"' in res, res
grp_numbers = scrape_search_results(res, 'group')
assert_equal(['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20'], grp_numbers)

res = self.app.get(url_for(controller='group', action='index', page=2))
assert 'href="/group?sort=&q=&page=1"' in res
assert 'href="/group?q=&sort=&page=1"' in res
grp_numbers = scrape_search_results(res, 'group')
assert_equal(['21'], grp_numbers)

Expand Down

0 comments on commit a89ce5a

Please sign in to comment.