mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 08:28:15 -04:00
Replace uses of client.get and client.post
We have a `client_request` fixture which does a bunch of useful stuff
like:
- checking the status code of the response
- returning a `BeautifulSoup` object
Lots of our tests still use an older fixture called `client`. This is
not as good because it:
- returns a raw `Response` object
- doesn’t do the additional checks
- means our tests contain a lot of repetetive boilerplate like `page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')`
This commit converts all the tests which had a `client.get(…)` or
`client.post(…)` statement to use their equivalents on `client_request`
instead.
Subsequent commits will remove uses of `client` in other tests, but
doing it this way means the work can be broken up into more manageable
chunks.
This commit is contained in:
@@ -498,7 +498,7 @@ def test_confirm_agreement_page_persists(
|
||||
('foo', 404),
|
||||
))
|
||||
def test_show_public_agreement_page(
|
||||
client,
|
||||
client_request,
|
||||
mocker,
|
||||
endpoint,
|
||||
variant,
|
||||
@@ -508,8 +508,9 @@ def test_show_public_agreement_page(
|
||||
'app.s3_client.s3_mou_client.get_s3_object',
|
||||
return_value=MockS3Object()
|
||||
)
|
||||
response = client.get(url_for(
|
||||
client_request.logout()
|
||||
client_request.get_response(
|
||||
endpoint,
|
||||
variant=variant,
|
||||
))
|
||||
assert response.status_code == expected_status
|
||||
_expected_status=expected_status,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user