diff --git a/allianceauth/analytics/tests/test_utils.py b/allianceauth/analytics/tests/test_utils.py index b9a22329..60ee44bd 100644 --- a/allianceauth/analytics/tests/test_utils.py +++ b/allianceauth/analytics/tests/test_utils.py @@ -1,7 +1,6 @@ from django.apps import apps from allianceauth.authentication.models import User -from esi.models import Token -from allianceauth.analytics.utils import install_stat_users, install_stat_tokens, install_stat_addons +from allianceauth.analytics.utils import install_stat_users, install_stat_addons from django.test.testcases import TestCase diff --git a/allianceauth/authentication/decorators.py b/allianceauth/authentication/decorators.py index d9d93faa..13b4ed0a 100644 --- a/allianceauth/authentication/decorators.py +++ b/allianceauth/authentication/decorators.py @@ -1,6 +1,3 @@ -from django.urls import include -from django.contrib.auth.decorators import user_passes_test -from django.core.exceptions import PermissionDenied from functools import wraps from typing import Callable, Iterable, Optional diff --git a/allianceauth/authentication/models.py b/allianceauth/authentication/models.py index 714f1934..3df43b4a 100644 --- a/allianceauth/authentication/models.py +++ b/allianceauth/authentication/models.py @@ -5,7 +5,6 @@ from django.db import models, transaction from django.utils.translation import gettext_lazy as _ from allianceauth.eveonline.models import EveCharacter, EveCorporationInfo, EveAllianceInfo, EveFactionInfo from allianceauth.notifications import notify -from django.conf import settings from .managers import CharacterOwnershipManager, StateManager diff --git a/allianceauth/authentication/tests/__init__.py b/allianceauth/authentication/tests/__init__.py index 13410df4..474a2c20 100644 --- a/allianceauth/authentication/tests/__init__.py +++ b/allianceauth/authentication/tests/__init__.py @@ -1,9 +1,3 @@ -from django.db.models.signals import ( - m2m_changed, - post_save, - pre_delete, - pre_save -) from django.urls import reverse from unittest import mock diff --git a/allianceauth/authentication/tests/test_middleware.py b/allianceauth/authentication/tests/test_middleware.py index 70335e58..10bd7ed0 100644 --- a/allianceauth/authentication/tests/test_middleware.py +++ b/allianceauth/authentication/tests/test_middleware.py @@ -1,4 +1,3 @@ -from unittest import mock from allianceauth.authentication.middleware import UserSettingsMiddleware from unittest.mock import Mock from django.http import HttpResponse diff --git a/allianceauth/authentication/tests/test_signals.py b/allianceauth/authentication/tests/test_signals.py index 8f7ba716..1e54e785 100644 --- a/allianceauth/authentication/tests/test_signals.py +++ b/allianceauth/authentication/tests/test_signals.py @@ -4,16 +4,10 @@ from allianceauth.eveonline.models import ( EveCorporationInfo, EveAllianceInfo ) -from django.db.models.signals import ( - pre_save, - post_save, - pre_delete, - m2m_changed -) +from django.db.models.signals import post_save from allianceauth.tests.auth_utils import AuthUtils from django.test.testcases import TestCase -from unittest.mock import Mock from . import patch diff --git a/allianceauth/authentication/views.py b/allianceauth/authentication/views.py index 2e8f4e2c..ea73a01f 100644 --- a/allianceauth/authentication/views.py +++ b/allianceauth/authentication/views.py @@ -11,7 +11,6 @@ from django.conf import settings from django.contrib import messages from django.contrib.auth import authenticate, login from django.contrib.auth.decorators import login_required, user_passes_test -from django.contrib.auth.models import User from django.core import signing from django.http import JsonResponse from django.shortcuts import redirect, render diff --git a/allianceauth/crontab/tests/test_utils.py b/allianceauth/crontab/tests/test_utils.py index 48592c99..563d42cf 100644 --- a/allianceauth/crontab/tests/test_utils.py +++ b/allianceauth/crontab/tests/test_utils.py @@ -1,5 +1,3 @@ -# myapp/tests/test_tasks.py - import logging from unittest.mock import patch from django.test import TestCase diff --git a/allianceauth/custom_css/widgets.py b/allianceauth/custom_css/widgets.py index 32ed07dd..f3da39cb 100644 --- a/allianceauth/custom_css/widgets.py +++ b/allianceauth/custom_css/widgets.py @@ -5,9 +5,6 @@ Form widgets for custom_css app # Django from django import forms -# Alliance Auth -from allianceauth.custom_css.models import CustomCSS - class CssEditorWidget(forms.Textarea): """ diff --git a/allianceauth/eveonline/autogroups/tests/test_models.py b/allianceauth/eveonline/autogroups/tests/test_models.py index f9c59389..4b04471d 100644 --- a/allianceauth/eveonline/autogroups/tests/test_models.py +++ b/allianceauth/eveonline/autogroups/tests/test_models.py @@ -1,6 +1,5 @@ from django.test import TestCase from django.contrib.auth.models import Group -from django.db import transaction from allianceauth.tests.auth_utils import AuthUtils diff --git a/allianceauth/eveonline/evelinks/tests/test_evelinks.py b/allianceauth/eveonline/evelinks/tests/test_evelinks.py index 09aa30fb..1b520edc 100644 --- a/allianceauth/eveonline/evelinks/tests/test_evelinks.py +++ b/allianceauth/eveonline/evelinks/tests/test_evelinks.py @@ -1,8 +1,6 @@ from django.test import TestCase -from ...models import EveCharacter, EveCorporationInfo, EveAllianceInfo from .. import dotlan, zkillboard, evewho, eveimageserver -from ...templatetags import evelinks class TestEveWho(TestCase): diff --git a/allianceauth/fleetactivitytracking/views.py b/allianceauth/fleetactivitytracking/views.py index 232fa456..fa7cd204 100644 --- a/allianceauth/fleetactivitytracking/views.py +++ b/allianceauth/fleetactivitytracking/views.py @@ -8,7 +8,7 @@ from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import permission_required from django.contrib.auth.models import User from django.core.exceptions import ValidationError, ObjectDoesNotExist -from django.shortcuts import render, redirect, get_object_or_404, Http404 +from django.shortcuts import render, redirect, get_object_or_404 from django.utils import timezone from django.utils.translation import gettext_lazy as _ from esi.decorators import token_required diff --git a/allianceauth/menu/tests/templatetags/test_menu_menu_items.py b/allianceauth/menu/tests/templatetags/test_menu_menu_items.py index 3e3e829a..66117b4f 100644 --- a/allianceauth/menu/tests/templatetags/test_menu_menu_items.py +++ b/allianceauth/menu/tests/templatetags/test_menu_menu_items.py @@ -186,7 +186,7 @@ class TestRenderDefaultMenu(TestCase): classes = "fa-solid fa-users-gear" url_name = "groupmanagement:management" - def render(Self, request): + def render(self, request): # simulate no perms return "" diff --git a/allianceauth/notifications/tests/test_templatetags.py b/allianceauth/notifications/tests/test_templatetags.py index 587970be..626d7226 100644 --- a/allianceauth/notifications/tests/test_templatetags.py +++ b/allianceauth/notifications/tests/test_templatetags.py @@ -1,4 +1,4 @@ -from unittest.mock import patch, Mock +from unittest.mock import patch from django.test import TestCase, override_settings diff --git a/allianceauth/notifications/tests/test_views.py b/allianceauth/notifications/tests/test_views.py index 7fa95bc8..2e8024da 100644 --- a/allianceauth/notifications/tests/test_views.py +++ b/allianceauth/notifications/tests/test_views.py @@ -1,6 +1,6 @@ import json -from unittest.mock import patch, Mock +from unittest.mock import patch from django.test import TestCase, RequestFactory from django.urls import reverse diff --git a/allianceauth/permissions_tool/views.py b/allianceauth/permissions_tool/views.py index e845a466..3552e04c 100644 --- a/allianceauth/permissions_tool/views.py +++ b/allianceauth/permissions_tool/views.py @@ -1,7 +1,7 @@ import logging from django.contrib.auth.decorators import login_required, permission_required -from django.contrib.auth.models import Permission, User +from django.contrib.auth.models import Permission from django.db.models import Count from django.shortcuts import render, Http404 diff --git a/allianceauth/services/hooks.py b/allianceauth/services/hooks.py index 084d8e49..ebfaa04b 100644 --- a/allianceauth/services/hooks.py +++ b/allianceauth/services/hooks.py @@ -1,13 +1,6 @@ from string import Formatter -from django.urls import include, re_path from typing import Iterable, Optional -from django.conf import settings -from django.core.exceptions import ObjectDoesNotExist -from django.template.loader import render_to_string -from django.urls import include, re_path -from django.utils.functional import cached_property - from allianceauth.hooks import get_hooks from allianceauth.menu.hooks import MenuItemHook from django.conf import settings diff --git a/allianceauth/services/modules/discord/tests/piloting_tasks.py b/allianceauth/services/modules/discord/tests/piloting_tasks.py index 4b1d0c7b..715d1b80 100644 --- a/allianceauth/services/modules/discord/tests/piloting_tasks.py +++ b/allianceauth/services/modules/discord/tests/piloting_tasks.py @@ -37,7 +37,6 @@ import random from django.contrib.auth.models import User, Group -from allianceauth.services.modules.discord.models import DiscordUser from allianceauth.utils.cache import get_redis_client logger = logging.getLogger('allianceauth') diff --git a/allianceauth/services/modules/discourse/manager.py b/allianceauth/services/modules/discourse/manager.py index 03cbbdee..fde966ea 100644 --- a/allianceauth/services/modules/discourse/manager.py +++ b/allianceauth/services/modules/discourse/manager.py @@ -1,5 +1,4 @@ import logging -import requests import re from django.conf import settings from django.core.cache import cache diff --git a/allianceauth/services/modules/discourse/views.py b/allianceauth/services/modules/discourse/views.py index a777fbb7..8a19f8e7 100644 --- a/allianceauth/services/modules/discourse/views.py +++ b/allianceauth/services/modules/discourse/views.py @@ -1,7 +1,7 @@ from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import login_required -from django.shortcuts import render, redirect +from django.shortcuts import redirect from django.utils.translation import gettext_lazy as _ from .manager import DiscourseManager diff --git a/allianceauth/services/modules/ips4/tasks.py b/allianceauth/services/modules/ips4/tasks.py index b6c5dce8..e2ba70c0 100644 --- a/allianceauth/services/modules/ips4/tasks.py +++ b/allianceauth/services/modules/ips4/tasks.py @@ -1,4 +1,3 @@ -from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from allianceauth.services.hooks import NameFormatter diff --git a/allianceauth/tests/test_auth_utils.py b/allianceauth/tests/test_auth_utils.py index 2fa5215c..027e6c1c 100644 --- a/allianceauth/tests/test_auth_utils.py +++ b/allianceauth/tests/test_auth_utils.py @@ -1,12 +1,6 @@ -from unittest import mock - from django.contrib.auth.models import User, Group, Permission from django.test import TestCase -from allianceauth.eveonline.models import ( - EveCorporationInfo, EveAllianceInfo, EveCharacter -) - from .auth_utils import AuthUtils diff --git a/allianceauth/urls.py b/allianceauth/urls.py index 71a43b26..16adfa9c 100644 --- a/allianceauth/urls.py +++ b/allianceauth/urls.py @@ -1,6 +1,5 @@ from typing import List, Iterable, Callable -from django.urls import include import esi.urls from django.conf import settings from django.contrib import admin