Use client_request fixture where possible

It:
- saves repetetive boilerplate code
- does some extra checks (eg checking for a `200` response)
- makes the codebase less confusing to consistently do the same thing in
  the same way
This commit is contained in:
Chris Hill-Scott
2019-03-26 12:35:32 +00:00
parent 6cf2b2531b
commit 883b07e3f0
19 changed files with 1436 additions and 1433 deletions

View File

@@ -39,15 +39,14 @@ def test_sign_in_explains_other_browser(logged_in_client, api_user_active, mocke
def test_doesnt_redirect_to_sign_in_if_no_session_info(
logged_in_client, api_user_active
client_request, api_user_active
):
assert api_user_active.current_session_id is None
with logged_in_client.session_transaction() as session:
with client_request.session_transaction() as session:
session['current_session_id'] = None
response = logged_in_client.get(url_for('main.add_service'))
assert response.status_code == 200
client_request.get('main.add_service')
@pytest.mark.parametrize('db_sess_id, cookie_sess_id', [