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:
Chris Hill-Scott
2022-01-04 18:33:23 +00:00
parent 7e707db4b2
commit 6540701aa7
19 changed files with 87 additions and 70 deletions

View File

@@ -577,7 +577,7 @@ STATISTICS = {
}
def test_get_status_filters_calculates_stats(client):
def test_get_status_filters_calculates_stats(client_request):
ret = get_status_filters(Service({'id': 'foo'}), 'sms', STATISTICS)
assert {label: count for label, _option, _link, count in ret} == {
@@ -588,7 +588,7 @@ def test_get_status_filters_calculates_stats(client):
}
def test_get_status_filters_in_right_order(client):
def test_get_status_filters_in_right_order(client_request):
ret = get_status_filters(Service({'id': 'foo'}), 'sms', STATISTICS)
assert [label for label, _option, _link, _count in ret] == [
@@ -596,7 +596,7 @@ def test_get_status_filters_in_right_order(client):
]
def test_get_status_filters_constructs_links(client):
def test_get_status_filters_constructs_links(client_request):
ret = get_status_filters(Service({'id': 'foo'}), 'sms', STATISTICS)
link = ret[0][2]