mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-07 03:28:25 -04:00
Replace uses of client to set request context
Some tests use the `client` fixture but don’t call any of its methods. The reason for doing this is because the test depends on something in the request context. This commit replaces all those instances with `client_request`, which also sets the request context. These tests are the last ones that still use the `client` fixture. By replacing it with `client_request` we will be able to say that no tests should be using the `client` fixture directly.
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
from app.utils.pagination import generate_next_dict, generate_previous_dict
|
||||
|
||||
|
||||
def test_generate_previous_dict(client):
|
||||
def test_generate_previous_dict(client_request):
|
||||
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):
|
||||
def test_generate_next_dict(client_request):
|
||||
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):
|
||||
def test_generate_previous_next_dict_adds_other_url_args(client_request):
|
||||
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