Use client and logged_in_client fixtures

Wherever possible, because Don’t Repeat Yourself.
This commit is contained in:
Chris Hill-Scott
2017-02-03 12:07:21 +00:00
parent 929dc45224
commit f3b0c0a556
32 changed files with 2389 additions and 2897 deletions

View File

@@ -15,17 +15,16 @@ def test_render_register_returns_template_with_form(client):
def test_logged_in_user_redirects_to_choose_service(
client,
logged_in_client,
api_user_active,
mock_get_user_by_email,
mock_send_verify_code,
mock_login,
):
client.login(api_user_active)
response = client.get(url_for('main.register'))
response = logged_in_client.get(url_for('main.register'))
assert response.status_code == 302
response = client.get(url_for('main.sign_in', follow_redirects=True))
response = logged_in_client.get(url_for('main.sign_in', follow_redirects=True))
assert response.location == url_for('main.choose_service', _external=True)