Use get_prev_next_pagination_links when searching by to field

The only change in behaviour is that we are no longer including a
`last` pagination link.

This is OK because the frontend doesnt use it, just the prev and
next links as per
https://github.com/alphagov/notifications-admin/blob/master/app/main/views/jobs.py#L248
This commit is contained in:
David McDonald
2021-12-10 11:50:16 +00:00
parent 6ac4e67f78
commit edadeb9131
2 changed files with 3 additions and 7 deletions

View File

@@ -2266,7 +2266,6 @@ def test_search_for_notification_by_to_field_returns_next_link_if_more_than_50(
assert len(response_json['notifications']) == 50
assert 'prev' not in response_json['links']
assert 'page=2' in response_json['links']['next']
assert 'page=2' in response_json['links']['last']
def test_search_for_notification_by_to_field_returns_no_next_link_if_50_or_less(