mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
Use test_client() as context manager
This commit is contained in:
@@ -16,11 +16,11 @@ def test_route_correct_secret_key(app_, check_proxy_header, header_value, expect
|
|||||||
'CHECK_PROXY_HEADER': check_proxy_header,
|
'CHECK_PROXY_HEADER': check_proxy_header,
|
||||||
}):
|
}):
|
||||||
|
|
||||||
client = app_.test_client()
|
with app_.test_client() as client:
|
||||||
response = client.get(
|
response = client.get(
|
||||||
path='/_status?elb=True',
|
path='/_status?elb=True',
|
||||||
headers=[
|
headers=[
|
||||||
('X-Custom-forwarder', header_value),
|
('X-Custom-forwarder', header_value),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
assert response.status_code == expected_code
|
assert response.status_code == expected_code
|
||||||
|
|||||||
Reference in New Issue
Block a user