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

@@ -248,7 +248,7 @@ def test_get_should_only_show_nhs_org_types_radios_if_user_has_nhs_email(
('other', 10_000),
])
def test_should_add_service_and_redirect_to_dashboard_when_existing_service(
app_,
notify_admin,
mocker,
client_request,
mock_create_service,
@@ -277,7 +277,7 @@ def test_should_add_service_and_redirect_to_dashboard_when_existing_service(
mock_create_service.assert_called_once_with(
service_name='testing the post',
organisation_type=organisation_type,
message_limit=app_.config['DEFAULT_SERVICE_LIMIT'],
message_limit=notify_admin.config['DEFAULT_SERVICE_LIMIT'],
restricted=True,
user_id=api_user_active['id'],
email_from='testing.the.post',