mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 08:44:23 -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:
@@ -651,9 +651,9 @@ def validate_route_permission_with_client(mocker,
|
||||
client.login(usr)
|
||||
resp = None
|
||||
if method == 'GET':
|
||||
resp = client.get(route)
|
||||
resp = client.get_response_from_url(route, _expected_status=response_code)
|
||||
elif method == 'POST':
|
||||
resp = client.post(route)
|
||||
resp = client.post_response_from_url(route, _expected_status=response_code)
|
||||
else:
|
||||
pytest.fail("Invalid method call {}".format(method))
|
||||
if resp.status_code != response_code:
|
||||
|
||||
Reference in New Issue
Block a user