mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-23 18:50:53 -04:00
Clarify variable name in pagination tests
We should avoid using abbreviations, as they aren't universally understood i.e. they're not worth the small saving in typing.
This commit is contained in:
@@ -2,19 +2,19 @@ from app.utils.pagination import generate_next_dict, generate_previous_dict
|
||||
|
||||
|
||||
def test_generate_previous_dict(client):
|
||||
ret = generate_previous_dict('main.view_jobs', 'foo', 2, {})
|
||||
assert 'page=1' in ret['url']
|
||||
assert ret['title'] == 'Previous page'
|
||||
assert ret['label'] == 'page 1'
|
||||
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):
|
||||
ret = generate_next_dict('main.view_jobs', 'foo', 2, {})
|
||||
assert 'page=3' in ret['url']
|
||||
assert ret['title'] == 'Next page'
|
||||
assert ret['label'] == 'page 3'
|
||||
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):
|
||||
ret = generate_next_dict('main.view_notifications', 'foo', 2, {'message_type': 'blah'})
|
||||
assert 'notifications/blah' in ret['url']
|
||||
result = generate_next_dict('main.view_notifications', 'foo', 2, {'message_type': 'blah'})
|
||||
assert 'notifications/blah' in result['url']
|
||||
|
||||
Reference in New Issue
Block a user