Rename "app_" fixture to "notify_admin"

This naming was introduced in 2016 without explanation [1]. I find it
confusing because:

- It's reminiscent of "_app", which is a Python convention indicating
the variable is internal, so maybe avoid using it.

- It suggests there's some other "app" fixture I should be using (there
isn't, though).

The Python style guide describes using an underscore suffix to avoid
clashes with inbuilt names [1], which is sort of applicable if we need
to import the "app" module [2]. However, we can also avoid clashes by
choosing a different name, without the strange underscore.

[1]: 3b1d521c10
[2]: 78824f54fd/tests/app/main/views/test_forgot_password.py (L5)
This commit is contained in:
Ben Thorner
2021-05-12 14:57:21 +01:00
parent 03295eb828
commit 5bfce61bcf
30 changed files with 163 additions and 164 deletions

View File

@@ -180,7 +180,7 @@ def test_spreadsheet_checks_for_bad_arguments(args, kwargs):
),
])
def test_generate_notifications_csv_without_job(
app_,
notify_admin,
mocker,
created_by_name,
expected_content,
@@ -224,7 +224,7 @@ def test_generate_notifications_csv_without_job(
),
])
def test_generate_notifications_csv_returns_correct_csv_file(
app_,
notify_admin,
mocker,
_get_notifications_csv_mock,
original_file_contents,
@@ -242,7 +242,7 @@ def test_generate_notifications_csv_returns_correct_csv_file(
def test_generate_notifications_csv_only_calls_once_if_no_next_link(
app_,
notify_admin,
_get_notifications_csv_mock,
):
list(generate_notifications_csv(service_id='1234'))
@@ -252,7 +252,7 @@ def test_generate_notifications_csv_only_calls_once_if_no_next_link(
@pytest.mark.parametrize("job_id", ["some", None])
def test_generate_notifications_csv_calls_twice_if_next_link(
app_,
notify_admin,
mocker,
job_id,
):