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/flexiblepricing/management/commands/create_product_for_program_courses.py b/flexiblepricing/management/commands/create_product_for_program_courses.py index 2390e289fd..ccaee7b730 100644 --- a/flexiblepricing/management/commands/create_product_for_program_courses.py +++ b/flexiblepricing/management/commands/create_product_for_program_courses.py @@ -36,7 +36,7 @@ class Command(BaseCommand): def create_parser(self, prog_name, subcommand): # pylint: disable=arguments-differ """ - create parser to add new line in help text. + Create parser to add new line in help text. """ parser = super().create_parser(prog_name, subcommand) parser.formatter_class = RawTextHelpFormatter 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/openedx/management/commands/regenerate_edx_auth_tokens.py b/openedx/management/commands/regenerate_edx_auth_tokens.py index 47d0611ea3..2bcf123dbf 100644 --- a/openedx/management/commands/regenerate_edx_auth_tokens.py +++ b/openedx/management/commands/regenerate_edx_auth_tokens.py @@ -21,7 +21,7 @@ class Command(BaseCommand): def create_parser(self, prog_name, subcommand): # pylint: disable=arguments-differ """ - create parser to add new line in help text. + Create parser to add new line in help text. """ parser = super().create_parser(prog_name, subcommand) parser.formatter_class = RawTextHelpFormatter diff --git a/users/management/commands/block_users.py b/users/management/commands/block_users.py index 024fb0b8f7..802b3692ca 100644 --- a/users/management/commands/block_users.py +++ b/users/management/commands/block_users.py @@ -29,7 +29,7 @@ class Command(BaseCommand): def create_parser(self, prog_name, subcommand): # pylint: disable=arguments-differ """ - create parser to add new line in help text. + Create parser to add new line in help text. """ parser = super().create_parser(prog_name, subcommand) parser.formatter_class = RawTextHelpFormatter diff --git a/users/management/commands/create_user.py b/users/management/commands/create_user.py index 140899c194..3f81e71cea 100644 --- a/users/management/commands/create_user.py +++ b/users/management/commands/create_user.py @@ -39,7 +39,7 @@ class Command(BaseCommand): def create_parser(self, prog_name, subcommand): # pylint: disable=arguments-differ """ - create parser to add new line in help text. + Create parser to add new line in help text. """ parser = super().create_parser(prog_name, subcommand) parser.formatter_class = RawTextHelpFormatter diff --git a/users/management/commands/find_username_conflicts.py b/users/management/commands/find_username_conflicts.py index 697e2a1202..6274f26491 100644 --- a/users/management/commands/find_username_conflicts.py +++ b/users/management/commands/find_username_conflicts.py @@ -23,7 +23,7 @@ def make_normalized_username(self, username): def create_parser(self, prog_name, subcommand): # pylint: disable=arguments-differ """ - create parser to add new line in help text. + Create parser to add new line in help text. """ parser = super().create_parser(prog_name, subcommand) parser.formatter_class = RawTextHelpFormatter diff --git a/users/management/commands/retire_users.py b/users/management/commands/retire_users.py index 24926848be..3e8b0e47c2 100644 --- a/users/management/commands/retire_users.py +++ b/users/management/commands/retire_users.py @@ -49,7 +49,7 @@ class Command(BaseCommand): def create_parser(self, prog_name, subcommand): # pylint: disable=arguments-differ """ - create parser to add new line in help text. + Create parser to add new line in help text. """ parser = super().create_parser(prog_name, subcommand) parser.formatter_class = RawTextHelpFormatter diff --git a/users/management/commands/unblock_users.py b/users/management/commands/unblock_users.py index 20515d4713..85d01dcefb 100644 --- a/users/management/commands/unblock_users.py +++ b/users/management/commands/unblock_users.py @@ -34,7 +34,7 @@ class Command(BaseCommand): def create_parser(self, prog_name, subcommand): # pylint: disable=arguments-differ """ - create parser to add new line in help text. + Create parser to add new line in help text. """ parser = super().create_parser(prog_name, subcommand) parser.formatter_class = RawTextHelpFormatter 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"