From 0dddffb2af70a017d62f52c974718a9e32d77f30 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 19:08:44 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- app/blueprints/assessments/forms/comments_form.py | 1 - app/blueprints/assessments/models/location_data.py | 1 - app/blueprints/authentication/validation.py | 2 -- app/blueprints/scoring/routes.py | 1 - build.py | 1 - config/envs/development.py | 1 - create_app.py | 1 - tasks.py | 1 - tests/test_applicators_response.py | 12 ++++++++---- tests/test_authorisation.py | 1 - tests/test_data_operations.py | 1 - tests/test_export.py | 6 ++++-- tests/test_tags.py | 3 --- 13 files changed, 12 insertions(+), 20 deletions(-) diff --git a/app/blueprints/assessments/forms/comments_form.py b/app/blueprints/assessments/forms/comments_form.py index 8c1e8e57..006ebdd2 100644 --- a/app/blueprints/assessments/forms/comments_form.py +++ b/app/blueprints/assessments/forms/comments_form.py @@ -6,7 +6,6 @@ class CommentsForm(FlaskForm): - comment = TextAreaField( "Comment", validators=[ diff --git a/app/blueprints/assessments/models/location_data.py b/app/blueprints/assessments/models/location_data.py index eabfb83b..c64bd98d 100644 --- a/app/blueprints/assessments/models/location_data.py +++ b/app/blueprints/assessments/models/location_data.py @@ -17,7 +17,6 @@ class LocationData: @classmethod def from_json_blob(cls, json_blob): - locations = [ location["location_json_blob"] for location in json_blob diff --git a/app/blueprints/authentication/validation.py b/app/blueprints/authentication/validation.py index a045d346..a60d6b95 100644 --- a/app/blueprints/authentication/validation.py +++ b/app/blueprints/authentication/validation.py @@ -101,7 +101,6 @@ def has_access_to_fund(short_name: str) -> bool: def check_access_application_id( func: Callable = None, roles_required: List[str] = [] ) -> Callable: - if func is None: return lambda f: check_access_application_id( func=f, roles_required=roles_required @@ -155,7 +154,6 @@ def _check_access_fund_common( roles_required: List[str] = [], fund_key: str = "fund_short_name", ) -> Callable: - if func is None: return lambda f: _check_access_fund_common( func=f, roles_required=roles_required, fund_key=fund_key diff --git a/app/blueprints/scoring/routes.py b/app/blueprints/scoring/routes.py index 97d187c2..b842a65e 100644 --- a/app/blueprints/scoring/routes.py +++ b/app/blueprints/scoring/routes.py @@ -140,7 +140,6 @@ def sub_crit_scoring(): form = ScoreForm() if form.validate_on_submit(): - score = int(form.score.data) just = form.justification.data diff --git a/build.py b/build.py index 21fc6127..ce1545ea 100644 --- a/build.py +++ b/build.py @@ -62,7 +62,6 @@ def build_govuk_assets(static_dist_root="app/static/dist"): cwd = os.getcwd() os.chdir(DIST_PATH) for css_file in glob.glob("*.css"): - # Read in the file with open(css_file, "r") as file: filedata = file.read() diff --git a/config/envs/development.py b/config/envs/development.py index 0effe24a..58e63588 100644 --- a/config/envs/development.py +++ b/config/envs/development.py @@ -8,7 +8,6 @@ @configclass class DevelopmentConfig(DefaultConfig): - # RSA 256 KEYS if not hasattr(DefaultConfig, "RSA256_PUBLIC_KEY"): _test_public_key_path = ( diff --git a/create_app.py b/create_app.py index e935710a..26597e31 100644 --- a/create_app.py +++ b/create_app.py @@ -44,7 +44,6 @@ def create_app() -> Flask: flask_app = Flask("Assessment Frontend") with flask_app.app_context(): - init_sentry() flask_app.config.from_object("config.Config") diff --git a/tasks.py b/tasks.py index efd7762d..ec3a6599 100644 --- a/tasks.py +++ b/tasks.py @@ -5,7 +5,6 @@ @task def copy_styles(c): - source_path = "./app/static/src/" dist_path = "./app/static/dist/" diff --git a/tests/test_applicators_response.py b/tests/test_applicators_response.py index f8ff846a..1366e5d1 100644 --- a/tests/test_applicators_response.py +++ b/tests/test_applicators_response.py @@ -362,10 +362,14 @@ class TestApplicatorsResponseComponentFactory: "form_name": "funding-required-ns", "presentation_type": "grouped_fields", "question": [ - "How much revenue are you applying for? 1 April 2023" - " to 31 March 2024", - "How much revenue are you applying for? 1 April 2023" - " to 31 March 2024", + ( + "How much revenue are you applying for? 1 April" + " 2023 to 31 March 2024" + ), + ( + "How much revenue are you applying for? 1 April" + " 2023 to 31 March 2024" + ), ], }, BesideQuestionAnswerPair, diff --git a/tests/test_authorisation.py b/tests/test_authorisation.py index 0a0b3a66..5b18743b 100644 --- a/tests/test_authorisation.py +++ b/tests/test_authorisation.py @@ -548,7 +548,6 @@ def test_resolve_flag_option_shows_for_correct_permissions( mock_get_associated_tags_for_application, mocker, ): - token = create_valid_token(user_account) flask_test_client.set_cookie("localhost", "fsd_user_token", token) application_id = request.node.get_closest_marker( diff --git a/tests/test_data_operations.py b/tests/test_data_operations.py index 6af3458a..a462e03b 100644 --- a/tests/test_data_operations.py +++ b/tests/test_data_operations.py @@ -7,7 +7,6 @@ class TestDataOperations: - test_app = Flask("app") def test_get_fund(self, mocker): diff --git a/tests/test_export.py b/tests/test_export.py index 8e7f751c..190ed3bc 100644 --- a/tests/test_export.py +++ b/tests/test_export.py @@ -84,7 +84,9 @@ def mock_list_objects_v2(Bucket, Prefix): # noqa ("awskey123123123123123/sample1.doc", "dummy/path/to/file.dmp"), ( "filename1.png", - "/assess/application/app_id/export/" - "form_name%252Fpath%252Fname%252Ffilename1.png?short_id=d_id"ed=True", + ( + "/assess/application/app_id/export/" + "form_name%252Fpath%252Fname%252Ffilename1.png?short_id=d_id"ed=True" + ), ), ] diff --git a/tests/test_tags.py b/tests/test_tags.py index 53ca2fc1..f3b799f7 100644 --- a/tests/test_tags.py +++ b/tests/test_tags.py @@ -89,7 +89,6 @@ def test_change_tags_route( mock_get_active_tags_for_fund_round, mock_get_associated_tags_for_application, ): - response = client_with_valid_session.get("/assess/application/app_id/tags") soup = BeautifulSoup(response.data, "html.parser") assert soup.find("h1").text == "Change tags" @@ -122,7 +121,6 @@ def test_change_tags_route_does_not_show_deactivated_tags_as_options( mock_get_inactive_tags_for_fund_round, mock_get_associated_tags_for_application, ): - response = client_with_valid_session.get("/assess/application/app_id/tags") soup = BeautifulSoup(response.data, "html.parser") assert soup.find("h1").text == "Change tags" @@ -145,7 +143,6 @@ def test_change_tags_route_associated_tag_checked( mock_get_active_tags_for_fund_round, mock_get_associated_tags_for_application, ): - response = client_with_valid_session.get("/assess/application/app_id/tags") soup = BeautifulSoup(response.data, "html.parser") assert soup.find("h1").text == "Change tags"