mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-10 10:03:21 -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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user