misc: fix unused-import pylint error (#56288)
This commit is contained in:
parent
d7e4849276
commit
ee21324c66
|
@ -18,7 +18,6 @@ import os
|
|||
|
||||
from django import template
|
||||
from django.db.models.fields.files import ImageFieldFile
|
||||
from django.utils import six
|
||||
from sorl.thumbnail.shortcuts import get_thumbnail
|
||||
|
||||
from ..models import Asset
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import json
|
||||
import os
|
||||
import tarfile
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
import json
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.db.models import Max, Min
|
||||
from django.http import (
|
||||
|
@ -32,7 +31,6 @@ from django.utils.encoding import force_text
|
|||
from django.views.decorators.csrf import csrf_exempt
|
||||
from django.views.generic import View
|
||||
|
||||
from combo.data.library import get_cell_class
|
||||
from combo.data.models import CellBase, ConfigJsonCell
|
||||
from combo.public.views import render_cell
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import sys
|
||||
from collections import OrderedDict
|
||||
|
||||
from django import forms
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
import copy
|
||||
import os
|
||||
import sys
|
||||
from collections import OrderedDict
|
||||
from datetime import date, datetime, timedelta
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import ckeditor.fields
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.http import urlencode
|
||||
|
||||
from combo.utils import requests
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from django import forms
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from .models import Image
|
||||
|
||||
|
|
|
@ -16,10 +16,8 @@
|
|||
|
||||
import json
|
||||
|
||||
from django import template
|
||||
from django.core import serializers
|
||||
from django.db import models
|
||||
from django.forms import models as model_forms
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from combo.data.library import register_cell_class
|
||||
|
|
|
@ -15,17 +15,8 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from django.shortcuts import redirect
|
||||
from django.urls import reverse, reverse_lazy
|
||||
from django.views.generic import (
|
||||
CreateView,
|
||||
DeleteView,
|
||||
DetailView,
|
||||
FormView,
|
||||
ListView,
|
||||
RedirectView,
|
||||
TemplateView,
|
||||
UpdateView,
|
||||
)
|
||||
from django.urls import reverse
|
||||
from django.views.generic import CreateView, UpdateView
|
||||
|
||||
from .forms import ImageAddForm, ImageEditForm
|
||||
from .models import GalleryCell, Image
|
||||
|
|
|
@ -14,11 +14,9 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import datetime
|
||||
import itertools
|
||||
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from combo.data.library import register_cell_class
|
||||
|
|
|
@ -26,7 +26,6 @@ from django.http import HttpResponse, HttpResponseRedirect
|
|||
from django.shortcuts import get_object_or_404
|
||||
from django.template.response import TemplateResponse
|
||||
from django.urls import reverse, reverse_lazy
|
||||
from django.utils import six
|
||||
from django.utils.timezone import make_aware, now
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.views.generic import CreateView, DeleteView, ListView, UpdateView, View
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import ckeditor.fields
|
||||
from django.db import migrations, models
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Generated by Django 2.2.19 on 2021-06-28 16:49
|
||||
|
||||
from django.db import migrations, models
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -36,7 +36,7 @@ from django.forms import Select
|
|||
from django.forms import models as model_forms
|
||||
from django.template.loader import render_to_string
|
||||
from django.urls import reverse
|
||||
from django.utils import dateparse, six, timezone
|
||||
from django.utils import dateparse, timezone
|
||||
from django.utils.encoding import force_bytes, python_2_unicode_compatible
|
||||
from django.utils.formats import localize
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
|
|
|
@ -39,7 +39,7 @@ from django.http import (
|
|||
from django.shortcuts import get_object_or_404
|
||||
from django.template.response import TemplateResponse
|
||||
from django.urls import reverse
|
||||
from django.utils import dateparse, six, timezone
|
||||
from django.utils import dateparse
|
||||
from django.utils.encoding import force_text, smart_text
|
||||
from django.utils.http import urlencode
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
|
|
@ -22,7 +22,6 @@ from django.conf import settings
|
|||
from django.core import serializers, validators
|
||||
from django.db import models
|
||||
from django.urls import reverse
|
||||
from django.utils import six
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from django.utils.html import escape
|
||||
from django.utils.text import slugify
|
||||
|
|
|
@ -23,7 +23,7 @@ class AppConfig(django.apps.AppConfig):
|
|||
name = 'combo.apps.pwa'
|
||||
|
||||
def ready(self):
|
||||
from . import signals
|
||||
from . import signals # noqa pylint: disable=unused-import
|
||||
|
||||
def get_before_urls(self):
|
||||
from . import urls
|
||||
|
|
|
@ -25,9 +25,7 @@ from django.core import serializers
|
|||
from django.core.files.base import ContentFile
|
||||
from django.core.files.storage import default_storage
|
||||
from django.db import models
|
||||
from django.utils import six
|
||||
from django.utils.encoding import force_bytes, force_text
|
||||
from django.utils.six import BytesIO
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from py_vapid import Vapid
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ from cryptography.hazmat.primitives import serialization
|
|||
from django.conf import settings
|
||||
from django.http import Http404, HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, JsonResponse
|
||||
from django.template.loader import TemplateDoesNotExist, get_template
|
||||
from django.utils.encoding import force_bytes, force_text
|
||||
from django.utils.encoding import force_text
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
from django.views.generic import TemplateView
|
||||
from py_vapid import Vapid
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from django.db import migrations, models
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db import migrations, models
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from django.db import migrations, models
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -19,7 +19,6 @@ import sys
|
|||
import traceback
|
||||
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import ckeditor.fields
|
||||
from django.db import migrations, models
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def create_parent_content_cells(apps, schema_editor):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from django.db import migrations, models
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Generated by Django 1.11.17 on 2020-01-19 09:17
|
||||
|
||||
from django.db import migrations, models
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -45,9 +45,9 @@ from django.db.models.signals import post_delete, post_save, pre_save
|
|||
from django.dispatch import receiver
|
||||
from django.forms import models as model_forms
|
||||
from django.forms.widgets import MediaDefiningClass
|
||||
from django.template import Context, TemplateDoesNotExist, TemplateSyntaxError, engines
|
||||
from django.template import TemplateDoesNotExist, TemplateSyntaxError, engines
|
||||
from django.test.client import RequestFactory
|
||||
from django.utils import six, timezone
|
||||
from django.utils import timezone
|
||||
from django.utils.encoding import force_text, python_2_unicode_compatible, smart_bytes
|
||||
from django.utils.html import strip_tags
|
||||
from django.utils.safestring import mark_safe
|
||||
|
|
|
@ -21,7 +21,6 @@ from django.conf import settings
|
|||
from django.contrib.auth.models import Group
|
||||
from django.core.serializers.base import DeserializationError
|
||||
from django.db import transaction
|
||||
from django.utils import six
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
|
|
@ -21,4 +21,4 @@ class ManagerAppConfig(AppConfig):
|
|||
name = 'combo.manager'
|
||||
|
||||
def ready(self):
|
||||
import combo.monkeypatch
|
||||
import combo.monkeypatch # noqa pylint: disable=unused-import
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import ckeditor.views as ckeditor_views
|
||||
from django.conf.urls import include, url
|
||||
from django.conf.urls import url
|
||||
from django.contrib.admin.views.decorators import staff_member_required
|
||||
from django.views.decorators.cache import never_cache
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ import copy
|
|||
import datetime
|
||||
import json
|
||||
import math
|
||||
import time
|
||||
from decimal import Decimal
|
||||
from decimal import DivisionByZero as DecimalDivisionByZero
|
||||
from decimal import InvalidOperation as DecimalInvalidOperation
|
||||
|
@ -41,7 +40,7 @@ except ImportError:
|
|||
|
||||
from django.template import Template, TemplateSyntaxError, defaultfilters
|
||||
from django.template.defaultfilters import stringfilter
|
||||
from django.utils import dateparse, six
|
||||
from django.utils import dateparse
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.html import format_html
|
||||
from django.utils.safestring import mark_safe
|
||||
|
|
|
@ -18,7 +18,6 @@ import json
|
|||
import re
|
||||
from itertools import chain
|
||||
|
||||
import django
|
||||
from django.conf import settings
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth import logout as auth_logout
|
||||
|
@ -54,7 +53,6 @@ else:
|
|||
|
||||
from combo import utils
|
||||
from combo.apps.assets.models import Asset
|
||||
from combo.apps.search.models import SearchCell
|
||||
from combo.data.models import (
|
||||
CellBase,
|
||||
Page,
|
||||
|
|
|
@ -19,7 +19,6 @@ import binascii
|
|||
from Cryptodome import Random
|
||||
from Cryptodome.Cipher import AES
|
||||
from Cryptodome.Protocol.KDF import PBKDF2
|
||||
from django.utils import six
|
||||
from django.utils.encoding import force_text
|
||||
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ import hmac
|
|||
import random
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils import six
|
||||
from django.utils.encoding import smart_bytes
|
||||
from django.utils.http import quote, urlencode
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
|
|
|
@ -50,6 +50,16 @@ def admin_user():
|
|||
return user
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def normal_user():
|
||||
try:
|
||||
user = User.objects.get(username='normal-user')
|
||||
user.groups = []
|
||||
except User.DoesNotExist:
|
||||
user = User.objects.create_user(username='normal-user', email='', password='normal-user')
|
||||
return user
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def nocache(settings):
|
||||
settings.CACHES = {
|
||||
|
|
|
@ -9,7 +9,7 @@ from django.urls import reverse
|
|||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
|
||||
from combo.apps.calendar.models import BookingCalendar
|
||||
from combo.apps.calendar.utils import get_calendar, get_chrono_events, get_chrono_service
|
||||
from combo.apps.calendar.utils import get_calendar, get_chrono_service
|
||||
from combo.data.models import Page
|
||||
|
||||
pytestmark = pytest.mark.django_db
|
||||
|
|
|
@ -7,14 +7,12 @@ import pytest
|
|||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.management import call_command
|
||||
from django.test import override_settings
|
||||
from django.urls import reverse
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
|
||||
from combo.apps.dashboard.models import DashboardCell, Tile
|
||||
from combo.data.models import CellBase, ConfigJsonCell, Page, TextCell
|
||||
from combo.wsgi import application
|
||||
from combo.data.models import Page, TextCell
|
||||
|
||||
pytestmark = pytest.mark.django_db
|
||||
|
||||
|
|
|
@ -1,22 +1,19 @@
|
|||
import json
|
||||
import urllib.parse
|
||||
from datetime import date, timedelta
|
||||
from datetime import date
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
from django.apps import apps
|
||||
from django.contrib.auth.models import Group, User
|
||||
from django.db import connection
|
||||
from django.db.migrations.executor import MigrationExecutor
|
||||
from django.contrib.auth.models import Group
|
||||
from django.test import override_settings
|
||||
from django.utils import timezone
|
||||
from httmock import HTTMock, remember_called, urlmatch, with_httmock
|
||||
from requests.exceptions import HTTPError
|
||||
|
||||
from combo.apps.dataviz.models import ChartNgCell, Gauge, Statistic, UnsupportedDataSet
|
||||
from combo.data.models import Page, ValidityInfo
|
||||
|
||||
from .test_public import login, normal_user
|
||||
from .test_public import login
|
||||
|
||||
pytestmark = pytest.mark.django_db
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import json
|
||||
import re
|
||||
from unittest import mock
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import os
|
|||
import pytest
|
||||
from django.urls import reverse
|
||||
|
||||
from combo.apps.gallery.models import GalleryCell, Image
|
||||
from combo.apps.gallery.models import GalleryCell
|
||||
from combo.data.models import Page
|
||||
|
||||
from .test_manager import login
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import base64
|
||||
import datetime
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
|
|
|
@ -12,7 +12,6 @@ from django.apps import apps
|
|||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.management import CommandError, call_command
|
||||
from django.db import transaction
|
||||
from django.http.request import QueryDict
|
||||
from django.test import override_settings
|
||||
from django.urls import reverse
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import json
|
||||
from datetime import timedelta as timedelta
|
||||
from datetime import timedelta
|
||||
from decimal import Decimal
|
||||
from unittest import mock
|
||||
|
||||
|
@ -9,7 +9,7 @@ from django.test import Client
|
|||
from django.test.client import RequestFactory
|
||||
from django.urls import reverse
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.timezone import now, timedelta
|
||||
from django.utils.timezone import now
|
||||
|
||||
from combo.apps.lingo.models import ActiveItems, PaymentBackend, Regie
|
||||
from combo.apps.notifications.models import Notification, NotificationsCell
|
||||
|
|
|
@ -6,7 +6,7 @@ from unittest import mock
|
|||
|
||||
import pytest
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import Group, User
|
||||
from django.contrib.auth.models import Group
|
||||
from django.core.files import File
|
||||
from django.db import connection
|
||||
from django.test import override_settings
|
||||
|
@ -17,7 +17,7 @@ from django.utils.six import StringIO
|
|||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
|
||||
try:
|
||||
import mellon
|
||||
import mellon # pylint: disable=unused-import
|
||||
except ImportError:
|
||||
mellon = None
|
||||
import requests
|
||||
|
@ -25,7 +25,6 @@ import requests
|
|||
from combo.apps.assets.models import Asset
|
||||
from combo.apps.family.models import FamilyInfosCell
|
||||
from combo.data.models import (
|
||||
CellBase,
|
||||
ConfigJsonCell,
|
||||
FeedCell,
|
||||
JsonCell,
|
||||
|
@ -36,23 +35,12 @@ from combo.data.models import (
|
|||
Redirect,
|
||||
TextCell,
|
||||
)
|
||||
from combo.wsgi import application
|
||||
|
||||
pytestmark = pytest.mark.django_db
|
||||
|
||||
from .test_manager import login
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def normal_user():
|
||||
try:
|
||||
user = User.objects.get(username='normal-user')
|
||||
user.groups = []
|
||||
except User.DoesNotExist:
|
||||
user = User.objects.create_user(username='normal-user', email='', password='normal-user')
|
||||
return user
|
||||
|
||||
|
||||
def test_missing_index(app):
|
||||
Page.objects.all().delete()
|
||||
resp = app.get('/', status=200)
|
||||
|
|
|
@ -4,7 +4,7 @@ import re
|
|||
|
||||
import pytest
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import Group, User
|
||||
from django.contrib.auth.models import Group
|
||||
|
||||
from combo.data.models import Page
|
||||
|
||||
|
@ -17,16 +17,6 @@ def login(app):
|
|||
test_manager.login(app, username='normal-user', password='normal-user')
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def normal_user():
|
||||
try:
|
||||
user = User.objects.get(username='normal-user')
|
||||
user.groups = []
|
||||
except User.DoesNotExist:
|
||||
user = User.objects.create_user(username='normal-user', email='', password='normal-user')
|
||||
return user
|
||||
|
||||
|
||||
class KnownServices:
|
||||
def __init__(self, known_services):
|
||||
self.known_services = known_services
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
import base64
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
import pywebpush
|
||||
from django.conf import settings
|
||||
from django.core.files import File
|
||||
from django.template import Context, Template
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import pytest
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import AnonymousUser
|
||||
from django.template import Context, RequestContext
|
||||
from django.test import override_settings
|
||||
from django.test.client import RequestFactory
|
||||
|
|
Loading…
Reference in New Issue