From 966b1f1b523092dba4eab25284800642b513d4d0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 23:13:25 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/sample/test_project/urls.py | 1 + tests/test_cli.py | 16 ++++++++++------ tests/test_enable.py | 8 +++++--- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/tests/sample/test_project/urls.py b/tests/sample/test_project/urls.py index 7f56d83..0527ba1 100644 --- a/tests/sample/test_project/urls.py +++ b/tests/sample/test_project/urls.py @@ -13,6 +13,7 @@ 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ + from django.conf.urls.i18n import i18n_patterns from django.contrib import admin from django.contrib.sitemaps.views import sitemap diff --git a/tests/test_cli.py b/tests/test_cli.py index cc037a8..2f645f4 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -35,9 +35,11 @@ def test_cli_sys_path(project_dir, blog_package): def test_cli_install(project_dir, blog_package): """Running install command calls the business functions with the correct arguments.""" - with patch("app_enabler.cli.enable_fun") as enable_fun, patch( - "app_enabler.cli.install_fun" - ) as install_fun, working_directory(project_dir): + with ( + patch("app_enabler.cli.enable_fun") as enable_fun, + patch("app_enabler.cli.install_fun") as install_fun, + working_directory(project_dir), + ): runner = CliRunner() result = runner.invoke(cli, ["--verbose", "install", "djangocms-blog"]) assert result.exit_code == 0 @@ -80,9 +82,11 @@ def test_cli_install_error_verbose(verbose: bool): @pytest.mark.parametrize("verbose", (True, False)) def test_cli_install_bad_application_verbose(verbose: bool): """Error due to bad application name is reported to the user.""" - with patch("app_enabler.cli.enable_fun") as enable_fun, patch("app_enabler.cli.install_fun"), patch( - "app_enabler.cli.get_application_from_package" - ) as get_application_from_package: + with ( + patch("app_enabler.cli.enable_fun") as enable_fun, + patch("app_enabler.cli.install_fun"), + patch("app_enabler.cli.get_application_from_package") as get_application_from_package, + ): get_application_from_package.return_value = None runner = CliRunner() diff --git a/tests/test_enable.py b/tests/test_enable.py index 992343d..0e9908c 100644 --- a/tests/test_enable.py +++ b/tests/test_enable.py @@ -58,9 +58,11 @@ def test_enable_minimal(capsys, pytester, project_dir, addon_config_minimal, tea def test_verify_fail(capsys, pytester, project_dir, addon_config_minimal, blog_package, teardown_django): """Enabling application load the addon configuration in settings and urlconf - minimal addon config.""" - with working_directory(project_dir), patch("app_enabler.enable.load_addon") as load_addon, patch( - "app_enabler.enable.verify_installation" - ) as verify_installation: + with ( + working_directory(project_dir), + patch("app_enabler.enable.load_addon") as load_addon, + patch("app_enabler.enable.verify_installation") as verify_installation, + ): load_addon.return_value = addon_config_minimal verify_installation.return_value = False os.environ["DJANGO_SETTINGS_MODULE"] = "test_project.settings"