mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-10 05:14:05 -05:00
We should avoid using abbreviations, as they aren't universally understood i.e. they're not worth the small saving in typing.
21 lines
742 B
Python
21 lines
742 B
Python
from app.utils.pagination import generate_next_dict, generate_previous_dict
|
|
|
|
|
|
def test_generate_previous_dict(client):
|
|
result = generate_previous_dict('main.view_jobs', 'foo', 2, {})
|
|
assert 'page=1' in result['url']
|
|
assert result['title'] == 'Previous page'
|
|
assert result['label'] == 'page 1'
|
|
|
|
|
|
def test_generate_next_dict(client):
|
|
result = generate_next_dict('main.view_jobs', 'foo', 2, {})
|
|
assert 'page=3' in result['url']
|
|
assert result['title'] == 'Next page'
|
|
assert result['label'] == 'page 3'
|
|
|
|
|
|
def test_generate_previous_next_dict_adds_other_url_args(client):
|
|
result = generate_next_dict('main.view_notifications', 'foo', 2, {'message_type': 'blah'})
|
|
assert 'notifications/blah' in result['url']
|