mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Stop using logged_in_client fixture
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 `logged_in_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 using `logged_in_client` to:
use `client_request` instead.
This commit is contained in:
@@ -175,7 +175,7 @@ def test_view_conversation(
|
||||
|
||||
|
||||
def test_view_conversation_updates(
|
||||
logged_in_client,
|
||||
client_request,
|
||||
mocker,
|
||||
fake_uuid,
|
||||
mock_get_inbound_sms_by_id_with_no_messages,
|
||||
@@ -191,13 +191,12 @@ def test_view_conversation_updates(
|
||||
return_value={'messages': 'foo'}
|
||||
)
|
||||
|
||||
response = logged_in_client.get(url_for(
|
||||
response = client_request.get_response(
|
||||
'main.conversation_updates',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
notification_id=fake_uuid,
|
||||
))
|
||||
)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert json.loads(response.get_data(as_text=True)) == {'messages': 'foo'}
|
||||
|
||||
mock_get_partials.assert_called_once_with(SERVICE_ONE_ID, '07123 456789')
|
||||
|
||||
Reference in New Issue
Block a user