mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -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:
@@ -555,17 +555,15 @@ def test_broadcast_dashboard_has_new_alert_button_if_user_has_permission_to_crea
|
||||
|
||||
@freeze_time('2020-02-20 02:20')
|
||||
def test_broadcast_dashboard_json(
|
||||
logged_in_client,
|
||||
client_request,
|
||||
service_one,
|
||||
mock_get_broadcast_messages,
|
||||
):
|
||||
service_one['permissions'] += ['broadcast']
|
||||
response = logged_in_client.get(url_for(
|
||||
response = client_request.get_response(
|
||||
'.broadcast_dashboard_updates',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
))
|
||||
|
||||
assert response.status_code == 200
|
||||
)
|
||||
|
||||
json_response = json.loads(response.get_data(as_text=True))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user