From ab3dedaa1d70b39db44d17933c986ad0c35ae3c6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 23:20:34 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- authentication/middleware.py | 2 +- authentication/pipeline/user_test.py | 2 +- conftest.py | 4 ++-- ecommerce/api_test.py | 2 +- ecommerce/views_test.py | 2 +- fixtures/common.py | 6 +++--- mail/api_test.py | 2 +- users/serializers_test.py | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/authentication/middleware.py b/authentication/middleware.py index a0012e4a04..0bd31ea87a 100644 --- a/authentication/middleware.py +++ b/authentication/middleware.py @@ -31,6 +31,6 @@ def process_exception(self, request, exception): if url: # noqa: RET503 url += ( - "?" in url and "&" or "?" + ("?" in url and "&") or "?" ) + f"message={quote(message)}&backend={backend_name}" return redirect(url) diff --git a/authentication/pipeline/user_test.py b/authentication/pipeline/user_test.py index 00424b8cc9..1e061a868b 100644 --- a/authentication/pipeline/user_test.py +++ b/authentication/pipeline/user_test.py @@ -64,7 +64,7 @@ def mock_create_user_strategy(mocker): @pytest.fixture -def application(settings): # noqa: PT004 +def application(settings): """Test data and settings needed for create_edx_user tests""" settings.OPENEDX_API_BASE_URL = "http://example.com" diff --git a/conftest.py b/conftest.py index 9c69e76817..efd4c052ac 100644 --- a/conftest.py +++ b/conftest.py @@ -9,7 +9,7 @@ @pytest.fixture(autouse=True) -def default_settings(monkeypatch, settings): # noqa: PT004 +def default_settings(monkeypatch, settings): """Set default settings for all tests""" monkeypatch.setenv("DJANGO_SETTINGS_MODULE", "main.settings") @@ -18,7 +18,7 @@ def default_settings(monkeypatch, settings): # noqa: PT004 @pytest.fixture(autouse=True) -def mocked_product_signal(mocker): # noqa: PT004 +def mocked_product_signal(mocker): """Mock hubspot_sync signals""" mocker.patch("ecommerce.signals.sync_hubspot_product") diff --git a/ecommerce/api_test.py b/ecommerce/api_test.py index cf339c6386..5d3fb86efe 100644 --- a/ecommerce/api_test.py +++ b/ecommerce/api_test.py @@ -110,7 +110,7 @@ def user(db): @pytest.fixture(autouse=True) -def payment_gateway_settings(): # noqa: PT004 +def payment_gateway_settings(): settings.MITOL_PAYMENT_GATEWAY_CYBERSOURCE_SECURITY_KEY = "Test Security Key" settings.MITOL_PAYMENT_GATEWAY_CYBERSOURCE_ACCESS_KEY = "Test Access Key" settings.MITOL_PAYMENT_GATEWAY_CYBERSOURCE_PROFILE_ID = uuid.uuid4() diff --git a/ecommerce/views_test.py b/ecommerce/views_test.py index 8154061baf..a0d2891a18 100644 --- a/ecommerce/views_test.py +++ b/ecommerce/views_test.py @@ -80,7 +80,7 @@ def user(db): @pytest.fixture(autouse=True) -def payment_gateway_settings(): # noqa: PT004 +def payment_gateway_settings(): settings.MITOL_PAYMENT_GATEWAY_CYBERSOURCE_SECURITY_KEY = "Test Security Key" settings.MITOL_PAYMENT_GATEWAY_CYBERSOURCE_ACCESS_KEY = "Test Access Key" settings.MITOL_PAYMENT_GATEWAY_CYBERSOURCE_PROFILE_ID = uuid.uuid4() diff --git a/fixtures/common.py b/fixtures/common.py index 610361300a..3eed0b46f4 100644 --- a/fixtures/common.py +++ b/fixtures/common.py @@ -131,13 +131,13 @@ def user_profile_dict(): @pytest.fixture -def nplusone_fail(settings): # noqa: PT004 +def nplusone_fail(settings): """Configures the nplusone app to raise errors""" settings.NPLUSONE_RAISE = True @pytest.fixture(autouse=True) -def webpack_stats(settings): # noqa: PT004 +def webpack_stats(settings): """Mocks out webpack stats""" directory = "scripts/test/data/webpack-stats/" @@ -151,7 +151,7 @@ def webpack_stats(settings): # noqa: PT004 @pytest.fixture -def raise_nplusone(request): # noqa: PT004 +def raise_nplusone(request): if request.node.get_closest_marker("skip_nplusone"): yield else: diff --git a/mail/api_test.py b/mail/api_test.py index f3465d2aaa..f8f771b546 100644 --- a/mail/api_test.py +++ b/mail/api_test.py @@ -25,7 +25,7 @@ @pytest.fixture -def email_settings(settings): # noqa: PT004 +def email_settings(settings): """Default settings for email tests""" settings.MAILGUN_RECIPIENT_OVERRIDE = None diff --git a/users/serializers_test.py b/users/serializers_test.py index 9314ac442d..afa45eedd9 100644 --- a/users/serializers_test.py +++ b/users/serializers_test.py @@ -29,7 +29,7 @@ @pytest.fixture -def application(settings): # noqa: PT004 +def application(settings): """Test data and settings needed for create_edx_user tests""" settings.OPENEDX_API_BASE_URL = "http://example.com"