From 962342d2b5994705b045040f82d7c5a78054a049 Mon Sep 17 00:00:00 2001 From: Sergei Maertens Date: Thu, 23 May 2024 15:08:40 +0200 Subject: [PATCH] :coffin: Delete unused type var --- mozilla_django_oidc_db/backends.py | 10 ++-------- tests/test_backend.py | 6 +++--- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/mozilla_django_oidc_db/backends.py b/mozilla_django_oidc_db/backends.py index d36eb59..a145bcc 100644 --- a/mozilla_django_oidc_db/backends.py +++ b/mozilla_django_oidc_db/backends.py @@ -3,7 +3,7 @@ import fnmatch import logging from collections.abc import Collection -from typing import Any, TypeAlias, TypeVar, cast +from typing import Any, TypeAlias, cast from django.contrib.auth import get_user_model from django.contrib.auth.models import ( @@ -23,11 +23,7 @@ from .config import dynamic_setting, get_setting_from_config, lookup_config from .exceptions import MissingIdentifierClaim from .jwt import verify_and_decode_token -from .models import ( - OpenIDConnectConfig, - OpenIDConnectConfigBase, - UserInformationClaimsSources, -) +from .models import OpenIDConnectConfigBase, UserInformationClaimsSources from .typing import ClaimPath, JSONObject from .utils import extract_content_type, obfuscate_claims @@ -35,8 +31,6 @@ AnyUser: TypeAlias = AnonymousUser | AbstractBaseUser -T = TypeVar("T", bound=OpenIDConnectConfig) - missing = object() diff --git a/tests/test_backend.py b/tests/test_backend.py index bc06c45..72ff6ee 100644 --- a/tests/test_backend.py +++ b/tests/test_backend.py @@ -657,11 +657,11 @@ def test_init_does_not_perform_config_io(mocker): * pytest will complain about database access which is forbidden because there is no pytest.mark.django_db present (deliberately) """ - m_get_solo = mocker.patch( - "mozilla_django_oidc_db.backends.OpenIDConnectConfig.get_solo" + m_get_setting = mocker.patch( + "mozilla_django_oidc_db.backends.get_setting_from_config" ) # instantiate OIDCAuthenticationBackend() - m_get_solo.assert_not_called() + m_get_setting.assert_not_called()