From 9cd7db57ff5be3625863621a1176cd209e086e10 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laur=C3=A9line=20Gu=C3=A9rin?= <zebuline@entrouvert.com>
Date: Fri, 20 Aug 2021 15:35:19 +0200
Subject: [PATCH 03/31] misc: fix unused-import pylint error (#56288)

---
 combo/apps/assets/templatetags/assets.py         |  1 -
 combo/apps/assets/views.py                       |  1 -
 combo/apps/dashboard/views.py                    |  2 --
 combo/apps/dataviz/forms.py                      |  1 -
 combo/apps/dataviz/models.py                     |  1 -
 combo/apps/family/migrations/0001_initial.py     |  1 -
 combo/apps/family/utils.py                       |  1 -
 combo/apps/gallery/forms.py                      |  1 -
 combo/apps/gallery/models.py                     |  2 --
 combo/apps/gallery/views.py                      | 13 ++-----------
 combo/apps/kb/models.py                          |  2 --
 combo/apps/lingo/manager_views.py                |  1 -
 .../lingo/migrations/0017_auto_20160327_0831.py  |  2 +-
 .../lingo/migrations/0043_auto_20210628_1849.py  |  2 +-
 combo/apps/lingo/models.py                       |  2 +-
 combo/apps/lingo/views.py                        |  2 +-
 combo/apps/maps/models.py                        |  1 -
 combo/apps/pwa/__init__.py                       |  2 +-
 combo/apps/pwa/models.py                         |  2 --
 combo/apps/pwa/views.py                          |  2 +-
 .../0004_remove_searchcell__search_service.py    |  2 +-
 .../migrations/0008_wcsformcell_cached_json.py   |  2 +-
 .../0009_remove_wcscategorycell_link_page.py     |  2 +-
 combo/data/management/commands/cron.py           |  1 -
 combo/data/migrations/0005_auto_20150226_0903.py |  2 +-
 .../data/migrations/0019_create_parent_cells.py  |  2 +-
 combo/data/migrations/0031_remove_blurps.py      |  2 +-
 combo/data/migrations/0040_auto_20200119_1017.py |  2 +-
 combo/data/models.py                             |  4 ++--
 combo/data/utils.py                              |  1 -
 combo/manager/apps.py                            |  2 +-
 combo/manager/urls.py                            |  2 +-
 combo/public/templatetags/combo.py               |  3 +--
 combo/public/views.py                            |  2 --
 combo/utils/crypto.py                            |  1 -
 combo/utils/signature.py                         |  1 -
 tests/conftest.py                                | 10 ++++++++++
 tests/test_calendar.py                           |  2 +-
 tests/test_dashboard.py                          |  4 +---
 tests/test_dataviz.py                            |  9 +++------
 tests/test_fargo.py                              |  1 -
 tests/test_gallery_cell.py                       |  2 +-
 tests/test_import_export.py                      |  1 -
 tests/test_lingo_payment.py                      |  1 -
 tests/test_notification.py                       |  4 ++--
 tests/test_public.py                             | 16 ++--------------
 tests/test_publik.py                             | 12 +-----------
 tests/test_pwa.py                                |  2 --
 tests/test_utils.py                              |  1 -
 49 files changed, 41 insertions(+), 97 deletions(-)

diff --git a/combo/apps/assets/templatetags/assets.py b/combo/apps/assets/templatetags/assets.py
index e974c1f0..69a7f61b 100644
--- a/combo/apps/assets/templatetags/assets.py
+++ b/combo/apps/assets/templatetags/assets.py
@@ -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
diff --git a/combo/apps/assets/views.py b/combo/apps/assets/views.py
index 09aa60d5..66d1e086 100644
--- a/combo/apps/assets/views.py
+++ b/combo/apps/assets/views.py
@@ -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
 
diff --git a/combo/apps/dashboard/views.py b/combo/apps/dashboard/views.py
index 14cf8cc2..1e39793c 100644
--- a/combo/apps/dashboard/views.py
+++ b/combo/apps/dashboard/views.py
@@ -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
 
diff --git a/combo/apps/dataviz/forms.py b/combo/apps/dataviz/forms.py
index cf724a94..fa9f09a5 100644
--- a/combo/apps/dataviz/forms.py
+++ b/combo/apps/dataviz/forms.py
@@ -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
diff --git a/combo/apps/dataviz/models.py b/combo/apps/dataviz/models.py
index e4ba7b93..37b4cd50 100644
--- a/combo/apps/dataviz/models.py
+++ b/combo/apps/dataviz/models.py
@@ -16,7 +16,6 @@
 
 import copy
 import os
-import sys
 from collections import OrderedDict
 from datetime import date, datetime, timedelta
 
diff --git a/combo/apps/family/migrations/0001_initial.py b/combo/apps/family/migrations/0001_initial.py
index 115e60f9..85df9846 100644
--- a/combo/apps/family/migrations/0001_initial.py
+++ b/combo/apps/family/migrations/0001_initial.py
@@ -1,4 +1,3 @@
-import ckeditor.fields
 from django.db import migrations, models
 
 
diff --git a/combo/apps/family/utils.py b/combo/apps/family/utils.py
index c772fb98..7771bb99 100644
--- a/combo/apps/family/utils.py
+++ b/combo/apps/family/utils.py
@@ -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
 
diff --git a/combo/apps/gallery/forms.py b/combo/apps/gallery/forms.py
index 69bf1e81..08c40fa6 100644
--- a/combo/apps/gallery/forms.py
+++ b/combo/apps/gallery/forms.py
@@ -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
 
diff --git a/combo/apps/gallery/models.py b/combo/apps/gallery/models.py
index 4d603423..295954d0 100644
--- a/combo/apps/gallery/models.py
+++ b/combo/apps/gallery/models.py
@@ -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
diff --git a/combo/apps/gallery/views.py b/combo/apps/gallery/views.py
index a3f5c9a3..b9c65242 100644
--- a/combo/apps/gallery/views.py
+++ b/combo/apps/gallery/views.py
@@ -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
diff --git a/combo/apps/kb/models.py b/combo/apps/kb/models.py
index b503ae15..2acc5128 100644
--- a/combo/apps/kb/models.py
+++ b/combo/apps/kb/models.py
@@ -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
diff --git a/combo/apps/lingo/manager_views.py b/combo/apps/lingo/manager_views.py
index a6771d12..fc37c78b 100644
--- a/combo/apps/lingo/manager_views.py
+++ b/combo/apps/lingo/manager_views.py
@@ -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
diff --git a/combo/apps/lingo/migrations/0017_auto_20160327_0831.py b/combo/apps/lingo/migrations/0017_auto_20160327_0831.py
index 2353e346..e0d70268 100644
--- a/combo/apps/lingo/migrations/0017_auto_20160327_0831.py
+++ b/combo/apps/lingo/migrations/0017_auto_20160327_0831.py
@@ -1,5 +1,5 @@
 import ckeditor.fields
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/combo/apps/lingo/migrations/0043_auto_20210628_1849.py b/combo/apps/lingo/migrations/0043_auto_20210628_1849.py
index 611563d5..0d4047e0 100644
--- a/combo/apps/lingo/migrations/0043_auto_20210628_1849.py
+++ b/combo/apps/lingo/migrations/0043_auto_20210628_1849.py
@@ -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):
diff --git a/combo/apps/lingo/models.py b/combo/apps/lingo/models.py
index de459d93..be2b9f9d 100644
--- a/combo/apps/lingo/models.py
+++ b/combo/apps/lingo/models.py
@@ -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
diff --git a/combo/apps/lingo/views.py b/combo/apps/lingo/views.py
index 970ce781..8c729281 100644
--- a/combo/apps/lingo/views.py
+++ b/combo/apps/lingo/views.py
@@ -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 _
diff --git a/combo/apps/maps/models.py b/combo/apps/maps/models.py
index 7ca1b05f..125eac5c 100644
--- a/combo/apps/maps/models.py
+++ b/combo/apps/maps/models.py
@@ -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
diff --git a/combo/apps/pwa/__init__.py b/combo/apps/pwa/__init__.py
index 63681c98..b5d26b3a 100644
--- a/combo/apps/pwa/__init__.py
+++ b/combo/apps/pwa/__init__.py
@@ -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
diff --git a/combo/apps/pwa/models.py b/combo/apps/pwa/models.py
index ba450982..5f2a7587 100644
--- a/combo/apps/pwa/models.py
+++ b/combo/apps/pwa/models.py
@@ -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
 
diff --git a/combo/apps/pwa/views.py b/combo/apps/pwa/views.py
index 6d4cb098..a67d356d 100644
--- a/combo/apps/pwa/views.py
+++ b/combo/apps/pwa/views.py
@@ -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
diff --git a/combo/apps/search/migrations/0004_remove_searchcell__search_service.py b/combo/apps/search/migrations/0004_remove_searchcell__search_service.py
index 64baa5f8..56ba7be9 100644
--- a/combo/apps/search/migrations/0004_remove_searchcell__search_service.py
+++ b/combo/apps/search/migrations/0004_remove_searchcell__search_service.py
@@ -1,4 +1,4 @@
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/combo/apps/wcs/migrations/0008_wcsformcell_cached_json.py b/combo/apps/wcs/migrations/0008_wcsformcell_cached_json.py
index 8c15badb..643da0fe 100644
--- a/combo/apps/wcs/migrations/0008_wcsformcell_cached_json.py
+++ b/combo/apps/wcs/migrations/0008_wcsformcell_cached_json.py
@@ -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):
diff --git a/combo/apps/wcs/migrations/0009_remove_wcscategorycell_link_page.py b/combo/apps/wcs/migrations/0009_remove_wcscategorycell_link_page.py
index 71c64973..c0d11933 100644
--- a/combo/apps/wcs/migrations/0009_remove_wcscategorycell_link_page.py
+++ b/combo/apps/wcs/migrations/0009_remove_wcscategorycell_link_page.py
@@ -1,4 +1,4 @@
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/combo/data/management/commands/cron.py b/combo/data/management/commands/cron.py
index de2c827f..5999bcf6 100644
--- a/combo/data/management/commands/cron.py
+++ b/combo/data/management/commands/cron.py
@@ -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
 
 
diff --git a/combo/data/migrations/0005_auto_20150226_0903.py b/combo/data/migrations/0005_auto_20150226_0903.py
index c73dbf9c..efae9b31 100644
--- a/combo/data/migrations/0005_auto_20150226_0903.py
+++ b/combo/data/migrations/0005_auto_20150226_0903.py
@@ -1,5 +1,5 @@
 import ckeditor.fields
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/combo/data/migrations/0019_create_parent_cells.py b/combo/data/migrations/0019_create_parent_cells.py
index d104ebcd..450a502b 100644
--- a/combo/data/migrations/0019_create_parent_cells.py
+++ b/combo/data/migrations/0019_create_parent_cells.py
@@ -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):
diff --git a/combo/data/migrations/0031_remove_blurps.py b/combo/data/migrations/0031_remove_blurps.py
index 342537fd..6c7835cc 100644
--- a/combo/data/migrations/0031_remove_blurps.py
+++ b/combo/data/migrations/0031_remove_blurps.py
@@ -1,4 +1,4 @@
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/combo/data/migrations/0040_auto_20200119_1017.py b/combo/data/migrations/0040_auto_20200119_1017.py
index fe2cdb74..23c1976b 100644
--- a/combo/data/migrations/0040_auto_20200119_1017.py
+++ b/combo/data/migrations/0040_auto_20200119_1017.py
@@ -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):
diff --git a/combo/data/models.py b/combo/data/models.py
index 7f451561..21381b82 100644
--- a/combo/data/models.py
+++ b/combo/data/models.py
@@ -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
diff --git a/combo/data/utils.py b/combo/data/utils.py
index 2ee6aa99..077927e3 100644
--- a/combo/data/utils.py
+++ b/combo/data/utils.py
@@ -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 _
 
diff --git a/combo/manager/apps.py b/combo/manager/apps.py
index 3333a0d1..61af3951 100644
--- a/combo/manager/apps.py
+++ b/combo/manager/apps.py
@@ -21,4 +21,4 @@ class ManagerAppConfig(AppConfig):
     name = 'combo.manager'
 
     def ready(self):
-        import combo.monkeypatch
+        import combo.monkeypatch  # noqa pylint: disable=unused-import
diff --git a/combo/manager/urls.py b/combo/manager/urls.py
index d957115e..1e1f09b4 100644
--- a/combo/manager/urls.py
+++ b/combo/manager/urls.py
@@ -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
 
diff --git a/combo/public/templatetags/combo.py b/combo/public/templatetags/combo.py
index 96dd0c7f..4da44762 100644
--- a/combo/public/templatetags/combo.py
+++ b/combo/public/templatetags/combo.py
@@ -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
diff --git a/combo/public/views.py b/combo/public/views.py
index 8be4fd1c..5eb3644b 100644
--- a/combo/public/views.py
+++ b/combo/public/views.py
@@ -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,
diff --git a/combo/utils/crypto.py b/combo/utils/crypto.py
index 9c543477..78ea1e28 100644
--- a/combo/utils/crypto.py
+++ b/combo/utils/crypto.py
@@ -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
 
 
diff --git a/combo/utils/signature.py b/combo/utils/signature.py
index 0cc74c7c..03b929d9 100644
--- a/combo/utils/signature.py
+++ b/combo/utils/signature.py
@@ -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
diff --git a/tests/conftest.py b/tests/conftest.py
index f9fe2606..e2e701bd 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -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 = {
diff --git a/tests/test_calendar.py b/tests/test_calendar.py
index ae8ba026..a352e8e0 100644
--- a/tests/test_calendar.py
+++ b/tests/test_calendar.py
@@ -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
diff --git a/tests/test_dashboard.py b/tests/test_dashboard.py
index b9cda9cf..25506b08 100644
--- a/tests/test_dashboard.py
+++ b/tests/test_dashboard.py
@@ -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
 
diff --git a/tests/test_dataviz.py b/tests/test_dataviz.py
index 67ea1a67..31237e88 100644
--- a/tests/test_dataviz.py
+++ b/tests/test_dataviz.py
@@ -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
 
diff --git a/tests/test_fargo.py b/tests/test_fargo.py
index 43242cab..b85a713e 100644
--- a/tests/test_fargo.py
+++ b/tests/test_fargo.py
@@ -1,4 +1,3 @@
-import json
 import re
 from unittest import mock
 
diff --git a/tests/test_gallery_cell.py b/tests/test_gallery_cell.py
index a095bf54..483bbb9d 100644
--- a/tests/test_gallery_cell.py
+++ b/tests/test_gallery_cell.py
@@ -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
diff --git a/tests/test_import_export.py b/tests/test_import_export.py
index 22c875a0..4246e1f7 100644
--- a/tests/test_import_export.py
+++ b/tests/test_import_export.py
@@ -1,5 +1,4 @@
 import base64
-import datetime
 import json
 import os
 import shutil
diff --git a/tests/test_lingo_payment.py b/tests/test_lingo_payment.py
index c8b92901..5e8b1389 100644
--- a/tests/test_lingo_payment.py
+++ b/tests/test_lingo_payment.py
@@ -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
diff --git a/tests/test_notification.py b/tests/test_notification.py
index 238c366d..0ebf6a53 100644
--- a/tests/test_notification.py
+++ b/tests/test_notification.py
@@ -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
diff --git a/tests/test_public.py b/tests/test_public.py
index 916f4904..edee3d1c 100644
--- a/tests/test_public.py
+++ b/tests/test_public.py
@@ -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)
diff --git a/tests/test_publik.py b/tests/test_publik.py
index 01813d8f..011d3dd3 100644
--- a/tests/test_publik.py
+++ b/tests/test_publik.py
@@ -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
diff --git a/tests/test_pwa.py b/tests/test_pwa.py
index 64362833..7cdec80b 100644
--- a/tests/test_pwa.py
+++ b/tests/test_pwa.py
@@ -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
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 2ea2ee5e..992c0772 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -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
-- 
2.30.2

