From 9655b3e3a6ea14b92627e7db1110f9867e83531e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laur=C3=A9line=20Gu=C3=A9rin?= <zebuline@entrouvert.com>
Date: Thu, 17 Mar 2022 15:42:52 +0100
Subject: [PATCH 05/65] misc: fix unused-import pylint error (#62099)

---
 .../migrations/0002_auto_20181118_0807.py              |  2 +-
 passerelle/apps/arcgis/models.py                       |  1 -
 .../apps/base_adresse/migrations/0006_rename_model.py  |  2 +-
 .../migrations/0008_delete_updatestreetmodel.py        |  2 +-
 .../base_adresse/migrations/0011_auto_20160919_0949.py |  2 +-
 .../migrations/0020_streetmodel_resource_runpython.py  |  3 +--
 .../migrations/0023_resource_in_models_runpython.py    |  3 +--
 passerelle/apps/base_adresse/models.py                 |  1 -
 passerelle/apps/bdp/models.py                          |  1 -
 passerelle/apps/cartads_cs/models.py                   |  1 -
 .../apps/choosit/migrations/0007_auto_20180814_1048.py |  2 +-
 .../apps/choosit/migrations/0008_auto_20181118_0807.py |  2 +-
 passerelle/apps/cityweb/cityweb.py                     |  1 -
 passerelle/apps/clicrdv/migrations/0001_initial.py     |  2 +-
 .../apps/clicrdv/migrations/0002_clicrdv_group_id.py   |  2 +-
 .../apps/clicrdv/migrations/0003_auto_20160920_0903.py |  2 +-
 .../apps/clicrdv/migrations/0005_auto_20161218_1701.py |  2 +-
 passerelle/apps/clicrdv/models.py                      |  4 ----
 passerelle/apps/clicrdv/urls.py                        |  3 +--
 .../apps/cmis/migrations/0003_auto_20181118_0807.py    |  2 +-
 passerelle/apps/cmis/urls.py                           |  2 +-
 .../migrations/0005_csvdatasource__dialect_options.py  |  2 +-
 .../migrations/0006_auto_20160905_1031.py              |  2 +-
 .../migrations/0012_auto_20180912_0215.py              |  2 +-
 .../migrations/0013_auto_20181118_0807.py              |  2 +-
 passerelle/apps/csvdatasource/urls.py                  |  2 +-
 passerelle/apps/family/loaders/concerto_fondettes.py   |  4 ----
 passerelle/apps/family/loaders/concerto_orleans.py     |  1 -
 passerelle/apps/family/loaders/opus_fondettes.py       |  4 ----
 .../family/management/commands/import_orleans_data.py  |  5 +----
 passerelle/apps/family/models.py                       |  2 +-
 .../apps/mobyt/migrations/0007_auto_20181118_0807.py   |  2 +-
 .../apps/opengis/migrations/0005_auto_20180227_1531.py |  1 -
 .../apps/opengis/migrations/0006_auto_20181118_0807.py |  2 +-
 .../apps/ovh/migrations/0007_auto_20181118_0807.py     |  2 +-
 passerelle/apps/ovh/views.py                           |  2 --
 .../apps/oxyd/migrations/0007_auto_20181118_0807.py    |  2 +-
 passerelle/apps/photon/models.py                       |  2 --
 passerelle/apps/solis/models.py                        |  1 -
 passerelle/base/migrations/0004_auto_20170117_0326.py  |  2 +-
 passerelle/base/migrations/0015_auto_20190921_0347.py  |  2 --
 passerelle/base/models.py                              |  1 -
 passerelle/base/views.py                               |  1 -
 passerelle/contrib/fake_family/models.py               |  1 -
 passerelle/contrib/fake_family/urls.py                 |  2 +-
 .../gdema/migrations/0002_auto_20181119_1446.py        |  2 +-
 passerelle/contrib/greco/models.py                     |  1 -
 .../iparapheur/migrations/0002_auto_20160406_1123.py   |  2 +-
 passerelle/contrib/iws/models.py                       |  1 -
 passerelle/contrib/mdph13/models.py                    |  3 +--
 passerelle/contrib/nancypoll/models.py                 |  1 -
 passerelle/contrib/solis_apa/models.py                 |  2 --
 passerelle/contrib/solis_apa/urls.py                   |  2 +-
 .../migrations/0002_management_billing_regies.py       |  2 +-
 .../migrations/0007_drop_wcs_form_api_url_pk.py        |  1 -
 .../migrations/0008_recreate_wscrequest_fk.py          |  2 --
 .../toulouse_smart/migrations/0011_rename_fk.py        |  3 +--
 passerelle/plugins.py                                  |  2 +-
 passerelle/sms/models.py                               |  1 -
 passerelle/sms/views.py                                |  1 -
 passerelle/utils/__init__.py                           |  1 -
 passerelle/utils/api.py                                |  2 +-
 passerelle/utils/conversion.py                         |  2 +-
 passerelle/utils/jsonresponse.py                       |  2 --
 tests/test_actesweb.py                                 |  2 --
 tests/test_api_access.py                               |  8 +-------
 tests/test_arcgis.py                                   |  1 -
 tests/test_astech.py                                   |  1 -
 tests/test_astre_rest.py                               |  1 -
 tests/test_cartads_cs.py                               |  1 -
 tests/test_cityweb.py                                  |  2 --
 tests/test_fake_family.py                              |  2 --
 tests/test_generic_endpoint.py                         | 10 +---------
 tests/test_gesbac.py                                   |  6 ++----
 tests/test_iparapheur.py                               |  1 -
 tests/test_isere_ens.py                                |  4 ----
 tests/test_jobs.py                                     |  7 ++++++-
 tests/test_jsondatastore.py                            |  2 +-
 tests/test_lille_kimoce.py                             |  1 -
 tests/test_maelis.py                                   |  1 -
 tests/test_opendatasoft.py                             |  1 -
 tests/test_opengis.py                                  |  1 -
 tests/test_phonecalls.py                               |  2 --
 tests/test_photon.py                                   |  1 -
 tests/test_requests.py                                 |  1 -
 tests/test_sms.py                                      |  3 ---
 tests/test_strasbourg_eu.py                            |  2 +-
 87 files changed, 49 insertions(+), 136 deletions(-)

diff --git a/passerelle/apps/api_particulier/migrations/0002_auto_20181118_0807.py b/passerelle/apps/api_particulier/migrations/0002_auto_20181118_0807.py
index f28cad0f..cf83599f 100644
--- a/passerelle/apps/api_particulier/migrations/0002_auto_20181118_0807.py
+++ b/passerelle/apps/api_particulier/migrations/0002_auto_20181118_0807.py
@@ -2,7 +2,7 @@
 # Generated by Django 1.11.12 on 2018-11-18 14:07
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/arcgis/models.py b/passerelle/apps/arcgis/models.py
index 03a50721..800a24ce 100644
--- a/passerelle/apps/arcgis/models.py
+++ b/passerelle/apps/arcgis/models.py
@@ -21,7 +21,6 @@ from django.db import models
 from django.http import HttpResponse
 from django.shortcuts import get_object_or_404
 from django.urls import reverse
-from django.utils import six
 from django.utils.six.moves.urllib import parse as urlparse
 from django.utils.text import slugify
 from django.utils.translation import ugettext_lazy as _
diff --git a/passerelle/apps/base_adresse/migrations/0006_rename_model.py b/passerelle/apps/base_adresse/migrations/0006_rename_model.py
index 3e097d37..a0a57414 100644
--- a/passerelle/apps/base_adresse/migrations/0006_rename_model.py
+++ b/passerelle/apps/base_adresse/migrations/0006_rename_model.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/base_adresse/migrations/0008_delete_updatestreetmodel.py b/passerelle/apps/base_adresse/migrations/0008_delete_updatestreetmodel.py
index ea591e12..30a42c88 100644
--- a/passerelle/apps/base_adresse/migrations/0008_delete_updatestreetmodel.py
+++ b/passerelle/apps/base_adresse/migrations/0008_delete_updatestreetmodel.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/base_adresse/migrations/0011_auto_20160919_0949.py b/passerelle/apps/base_adresse/migrations/0011_auto_20160919_0949.py
index 709bda0d..70a0a8fe 100644
--- a/passerelle/apps/base_adresse/migrations/0011_auto_20160919_0949.py
+++ b/passerelle/apps/base_adresse/migrations/0011_auto_20160919_0949.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/base_adresse/migrations/0020_streetmodel_resource_runpython.py b/passerelle/apps/base_adresse/migrations/0020_streetmodel_resource_runpython.py
index f4dcf615..4b45f769 100644
--- a/passerelle/apps/base_adresse/migrations/0020_streetmodel_resource_runpython.py
+++ b/passerelle/apps/base_adresse/migrations/0020_streetmodel_resource_runpython.py
@@ -1,7 +1,6 @@
 # Generated by Django 2.2.24 on 2021-08-03 17:47
 
-import django.db.models.deletion
-from django.db import migrations, models
+from django.db import migrations
 
 
 def set_streetmodel_resource(apps, schema_editor):
diff --git a/passerelle/apps/base_adresse/migrations/0023_resource_in_models_runpython.py b/passerelle/apps/base_adresse/migrations/0023_resource_in_models_runpython.py
index 42839633..2915d229 100644
--- a/passerelle/apps/base_adresse/migrations/0023_resource_in_models_runpython.py
+++ b/passerelle/apps/base_adresse/migrations/0023_resource_in_models_runpython.py
@@ -1,7 +1,6 @@
 # Generated by Django 2.2.19 on 2021-08-03 18:35
 
-import django.db.models.deletion
-from django.db import migrations, models
+from django.db import migrations
 
 
 def set_resource(apps, schema_editor):
diff --git a/passerelle/apps/base_adresse/models.py b/passerelle/apps/base_adresse/models.py
index ad04a3fb..c4618ae6 100644
--- a/passerelle/apps/base_adresse/models.py
+++ b/passerelle/apps/base_adresse/models.py
@@ -10,7 +10,6 @@ from django.utils.six import StringIO
 from django.utils.six.moves.urllib import parse as urlparse
 from django.utils.translation import ugettext_lazy as _
 from requests import RequestException
-from requests.exceptions import ConnectionError
 
 from passerelle.address.models import AddressResource
 from passerelle.compat import json_loads
diff --git a/passerelle/apps/bdp/models.py b/passerelle/apps/bdp/models.py
index a3b4282e..709fadb2 100644
--- a/passerelle/apps/bdp/models.py
+++ b/passerelle/apps/bdp/models.py
@@ -2,7 +2,6 @@ import json
 
 import requests
 from django.db import models
-from django.urls import reverse
 from django.utils.translation import ugettext_lazy as _
 from requests.auth import HTTPBasicAuth
 
diff --git a/passerelle/apps/cartads_cs/models.py b/passerelle/apps/cartads_cs/models.py
index cd6f2580..43bc30a6 100644
--- a/passerelle/apps/cartads_cs/models.py
+++ b/passerelle/apps/cartads_cs/models.py
@@ -39,7 +39,6 @@ from django.http import HttpResponse
 from django.urls import reverse
 from django.utils.encoding import force_text
 from django.utils.six.moves.urllib import parse as urlparse
-from django.utils.text import slugify
 from django.utils.timezone import now
 from django.utils.translation import ugettext_lazy as _
 
diff --git a/passerelle/apps/choosit/migrations/0007_auto_20180814_1048.py b/passerelle/apps/choosit/migrations/0007_auto_20180814_1048.py
index f06fbb75..350c5385 100644
--- a/passerelle/apps/choosit/migrations/0007_auto_20180814_1048.py
+++ b/passerelle/apps/choosit/migrations/0007_auto_20180814_1048.py
@@ -2,7 +2,7 @@
 # Generated by Django 1.11.12 on 2018-08-14 15:48
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/choosit/migrations/0008_auto_20181118_0807.py b/passerelle/apps/choosit/migrations/0008_auto_20181118_0807.py
index b1d4124d..851da8d7 100644
--- a/passerelle/apps/choosit/migrations/0008_auto_20181118_0807.py
+++ b/passerelle/apps/choosit/migrations/0008_auto_20181118_0807.py
@@ -2,7 +2,7 @@
 # Generated by Django 1.11.12 on 2018-11-18 14:07
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/cityweb/cityweb.py b/passerelle/apps/cityweb/cityweb.py
index 64320ebd..2fc88415 100644
--- a/passerelle/apps/cityweb/cityweb.py
+++ b/passerelle/apps/cityweb/cityweb.py
@@ -17,7 +17,6 @@
 import os
 import stat
 
-from django.core.files.base import ContentFile
 from django.core.files.storage import default_storage
 from django.utils import six
 from django.utils.dateparse import parse_date
diff --git a/passerelle/apps/clicrdv/migrations/0001_initial.py b/passerelle/apps/clicrdv/migrations/0001_initial.py
index 4b87a038..4df05941 100644
--- a/passerelle/apps/clicrdv/migrations/0001_initial.py
+++ b/passerelle/apps/clicrdv/migrations/0001_initial.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/clicrdv/migrations/0002_clicrdv_group_id.py b/passerelle/apps/clicrdv/migrations/0002_clicrdv_group_id.py
index ebe847a1..23089def 100644
--- a/passerelle/apps/clicrdv/migrations/0002_clicrdv_group_id.py
+++ b/passerelle/apps/clicrdv/migrations/0002_clicrdv_group_id.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/clicrdv/migrations/0003_auto_20160920_0903.py b/passerelle/apps/clicrdv/migrations/0003_auto_20160920_0903.py
index d371eb3d..9c65167c 100644
--- a/passerelle/apps/clicrdv/migrations/0003_auto_20160920_0903.py
+++ b/passerelle/apps/clicrdv/migrations/0003_auto_20160920_0903.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/clicrdv/migrations/0005_auto_20161218_1701.py b/passerelle/apps/clicrdv/migrations/0005_auto_20161218_1701.py
index d547e3e3..7a4b6abc 100644
--- a/passerelle/apps/clicrdv/migrations/0005_auto_20161218_1701.py
+++ b/passerelle/apps/clicrdv/migrations/0005_auto_20161218_1701.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/clicrdv/models.py b/passerelle/apps/clicrdv/models.py
index 8e045966..4cd13d84 100644
--- a/passerelle/apps/clicrdv/models.py
+++ b/passerelle/apps/clicrdv/models.py
@@ -4,14 +4,10 @@ Datasource for a ClicRDV instance.
 It is a gateway to http://developers.clicrdv.com/fr/rest-api.html
 '''
 
-import base64
 import datetime
-import json
 
 import requests
-from django.conf import settings
 from django.db import models
-from django.urls import reverse
 from django.utils.dateformat import format as date_format
 from django.utils.dateformat import time_format
 from django.utils.http import urlquote
diff --git a/passerelle/apps/clicrdv/urls.py b/passerelle/apps/clicrdv/urls.py
index 427bec84..ebe3fb63 100644
--- a/passerelle/apps/clicrdv/urls.py
+++ b/passerelle/apps/clicrdv/urls.py
@@ -1,8 +1,7 @@
-from django.conf.urls import include, url
+from django.conf.urls import url
 from django.views.decorators.csrf import csrf_exempt
 
 from passerelle.apps.clicrdv.views import *
-from passerelle.urls_utils import app_enabled, decorated_includes, required
 
 urlpatterns = [
     url(r'^(?P<slug>[\w,-]+)/$', ClicRdvDetailView.as_view(), name='clicrdv-view'),
diff --git a/passerelle/apps/cmis/migrations/0003_auto_20181118_0807.py b/passerelle/apps/cmis/migrations/0003_auto_20181118_0807.py
index 7d65b899..d52d6264 100644
--- a/passerelle/apps/cmis/migrations/0003_auto_20181118_0807.py
+++ b/passerelle/apps/cmis/migrations/0003_auto_20181118_0807.py
@@ -2,7 +2,7 @@
 # Generated by Django 1.11.12 on 2018-11-18 14:07
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/cmis/urls.py b/passerelle/apps/cmis/urls.py
index 489d69d6..15a1d6a2 100644
--- a/passerelle/apps/cmis/urls.py
+++ b/passerelle/apps/cmis/urls.py
@@ -14,7 +14,7 @@
 # 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/>.
 
-from django.conf.urls import include, url
+from django.conf.urls import url
 
 from .views import CmisTypeView
 
diff --git a/passerelle/apps/csvdatasource/migrations/0005_csvdatasource__dialect_options.py b/passerelle/apps/csvdatasource/migrations/0005_csvdatasource__dialect_options.py
index b62512c3..5b3168c8 100644
--- a/passerelle/apps/csvdatasource/migrations/0005_csvdatasource__dialect_options.py
+++ b/passerelle/apps/csvdatasource/migrations/0005_csvdatasource__dialect_options.py
@@ -2,7 +2,7 @@
 from __future__ import unicode_literals
 
 import django.contrib.postgres.fields.jsonb
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/csvdatasource/migrations/0006_auto_20160905_1031.py b/passerelle/apps/csvdatasource/migrations/0006_auto_20160905_1031.py
index 0a6ec95c..5d38da3d 100644
--- a/passerelle/apps/csvdatasource/migrations/0006_auto_20160905_1031.py
+++ b/passerelle/apps/csvdatasource/migrations/0006_auto_20160905_1031.py
@@ -2,7 +2,7 @@
 from __future__ import unicode_literals
 
 import django.contrib.postgres.fields.jsonb
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/csvdatasource/migrations/0012_auto_20180912_0215.py b/passerelle/apps/csvdatasource/migrations/0012_auto_20180912_0215.py
index 64120644..165252b8 100644
--- a/passerelle/apps/csvdatasource/migrations/0012_auto_20180912_0215.py
+++ b/passerelle/apps/csvdatasource/migrations/0012_auto_20180912_0215.py
@@ -2,7 +2,7 @@
 # Generated by Django 1.11.12 on 2018-09-12 07:15
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/csvdatasource/migrations/0013_auto_20181118_0807.py b/passerelle/apps/csvdatasource/migrations/0013_auto_20181118_0807.py
index a879a031..f58b8253 100644
--- a/passerelle/apps/csvdatasource/migrations/0013_auto_20181118_0807.py
+++ b/passerelle/apps/csvdatasource/migrations/0013_auto_20181118_0807.py
@@ -2,7 +2,7 @@
 # Generated by Django 1.11.12 on 2018-11-18 14:07
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/csvdatasource/urls.py b/passerelle/apps/csvdatasource/urls.py
index 503bceb7..45484d8d 100644
--- a/passerelle/apps/csvdatasource/urls.py
+++ b/passerelle/apps/csvdatasource/urls.py
@@ -14,7 +14,7 @@
 # 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/>.
 
-from django.conf.urls import include, url
+from django.conf.urls import url
 
 from .views import *
 
diff --git a/passerelle/apps/family/loaders/concerto_fondettes.py b/passerelle/apps/family/loaders/concerto_fondettes.py
index cc3f21de..c2c22a30 100644
--- a/passerelle/apps/family/loaders/concerto_fondettes.py
+++ b/passerelle/apps/family/loaders/concerto_fondettes.py
@@ -16,10 +16,6 @@
 
 import csv
 import datetime
-import json
-import os
-import sys
-import zipfile
 from decimal import Decimal
 
 from django.core.exceptions import ValidationError
diff --git a/passerelle/apps/family/loaders/concerto_orleans.py b/passerelle/apps/family/loaders/concerto_orleans.py
index d22401fa..d9a05455 100644
--- a/passerelle/apps/family/loaders/concerto_orleans.py
+++ b/passerelle/apps/family/loaders/concerto_orleans.py
@@ -22,7 +22,6 @@ from django.core.exceptions import ValidationError
 from django.core.files.storage import DefaultStorage
 from django.utils import six, timezone
 from django.utils.encoding import force_text
-from django.utils.timezone import datetime, make_aware
 from django.utils.translation import ugettext_lazy as _
 
 from ..models import Adult, Child, Family, Invoice, dict_cherry_pick, get_date, get_datetime
diff --git a/passerelle/apps/family/loaders/opus_fondettes.py b/passerelle/apps/family/loaders/opus_fondettes.py
index 25fd8b7f..4ac4e350 100644
--- a/passerelle/apps/family/loaders/opus_fondettes.py
+++ b/passerelle/apps/family/loaders/opus_fondettes.py
@@ -16,10 +16,6 @@
 
 import csv
 import datetime
-import json
-import os
-import sys
-import zipfile
 from decimal import Decimal
 
 from django.core.exceptions import ValidationError
diff --git a/passerelle/apps/family/management/commands/import_orleans_data.py b/passerelle/apps/family/management/commands/import_orleans_data.py
index 3457bbc9..c477f9ee 100644
--- a/passerelle/apps/family/management/commands/import_orleans_data.py
+++ b/passerelle/apps/family/management/commands/import_orleans_data.py
@@ -16,15 +16,12 @@
 
 import fcntl
 import os
-import sys
-import tempfile
-import zipfile
 
 from django.core.files.base import File
 from django.core.files.storage import DefaultStorage
 from django.core.management.base import BaseCommand, CommandError
 
-from passerelle.apps.family.models import GenericFamily, Invoice
+from passerelle.apps.family.models import GenericFamily
 
 
 class Command(BaseCommand):
diff --git a/passerelle/apps/family/models.py b/passerelle/apps/family/models.py
index 1b049b65..99a5b267 100644
--- a/passerelle/apps/family/models.py
+++ b/passerelle/apps/family/models.py
@@ -28,7 +28,7 @@ from django.core.files.storage import default_storage
 from django.db import models, transaction
 from django.http import Http404, HttpResponse
 from django.utils import six
-from django.utils.timezone import datetime, is_naive, make_aware, now
+from django.utils.timezone import datetime, make_aware, now
 from django.utils.translation import ugettext_lazy as _
 
 from passerelle.base.models import BaseResource
diff --git a/passerelle/apps/mobyt/migrations/0007_auto_20181118_0807.py b/passerelle/apps/mobyt/migrations/0007_auto_20181118_0807.py
index dc571184..29271fec 100644
--- a/passerelle/apps/mobyt/migrations/0007_auto_20181118_0807.py
+++ b/passerelle/apps/mobyt/migrations/0007_auto_20181118_0807.py
@@ -2,7 +2,7 @@
 # Generated by Django 1.11.12 on 2018-11-18 14:07
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/opengis/migrations/0005_auto_20180227_1531.py b/passerelle/apps/opengis/migrations/0005_auto_20180227_1531.py
index bb710926..e282913b 100644
--- a/passerelle/apps/opengis/migrations/0005_auto_20180227_1531.py
+++ b/passerelle/apps/opengis/migrations/0005_auto_20180227_1531.py
@@ -1,7 +1,6 @@
 # -*- coding: utf-8 -*-
 from __future__ import unicode_literals
 
-import django.contrib.postgres.fields.jsonb
 from django.db import migrations, models
 
 
diff --git a/passerelle/apps/opengis/migrations/0006_auto_20181118_0807.py b/passerelle/apps/opengis/migrations/0006_auto_20181118_0807.py
index 7cf44097..a0f2e71f 100644
--- a/passerelle/apps/opengis/migrations/0006_auto_20181118_0807.py
+++ b/passerelle/apps/opengis/migrations/0006_auto_20181118_0807.py
@@ -2,7 +2,7 @@
 # Generated by Django 1.11.12 on 2018-11-18 14:07
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/ovh/migrations/0007_auto_20181118_0807.py b/passerelle/apps/ovh/migrations/0007_auto_20181118_0807.py
index 251fc3ac..3cfe3f39 100644
--- a/passerelle/apps/ovh/migrations/0007_auto_20181118_0807.py
+++ b/passerelle/apps/ovh/migrations/0007_auto_20181118_0807.py
@@ -2,7 +2,7 @@
 # Generated by Django 1.11.12 on 2018-11-18 14:07
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/ovh/views.py b/passerelle/apps/ovh/views.py
index 2cfd7232..aa3401d7 100644
--- a/passerelle/apps/ovh/views.py
+++ b/passerelle/apps/ovh/views.py
@@ -1,7 +1,5 @@
 import uuid
-from urllib.parse import urljoin
 
-from django.conf import settings
 from django.contrib import messages
 from django.shortcuts import reverse
 from django.utils.translation import ugettext_lazy as _
diff --git a/passerelle/apps/oxyd/migrations/0007_auto_20181118_0807.py b/passerelle/apps/oxyd/migrations/0007_auto_20181118_0807.py
index abcdb174..2dafbefc 100644
--- a/passerelle/apps/oxyd/migrations/0007_auto_20181118_0807.py
+++ b/passerelle/apps/oxyd/migrations/0007_auto_20181118_0807.py
@@ -2,7 +2,7 @@
 # Generated by Django 1.11.12 on 2018-11-18 14:07
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/apps/photon/models.py b/passerelle/apps/photon/models.py
index 70c8502b..f12630aa 100644
--- a/passerelle/apps/photon/models.py
+++ b/passerelle/apps/photon/models.py
@@ -14,13 +14,11 @@
 # 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 hashlib
 import json
 
 from django.contrib.postgres.fields import JSONField
 from django.db import models
-from django.utils import timezone
 from django.utils.encoding import force_bytes
 from django.utils.http import urlencode
 from django.utils.six.moves.urllib import parse as urlparse
diff --git a/passerelle/apps/solis/models.py b/passerelle/apps/solis/models.py
index 17646cdd..54d4de8b 100644
--- a/passerelle/apps/solis/models.py
+++ b/passerelle/apps/solis/models.py
@@ -16,7 +16,6 @@
 
 import base64
 import copy
-import re
 
 from django.db import models
 from django.template.loader import get_template
diff --git a/passerelle/base/migrations/0004_auto_20170117_0326.py b/passerelle/base/migrations/0004_auto_20170117_0326.py
index acefbed7..22d8ec96 100644
--- a/passerelle/base/migrations/0004_auto_20170117_0326.py
+++ b/passerelle/base/migrations/0004_auto_20170117_0326.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/base/migrations/0015_auto_20190921_0347.py b/passerelle/base/migrations/0015_auto_20190921_0347.py
index 2a09a4fc..fd685c82 100644
--- a/passerelle/base/migrations/0015_auto_20190921_0347.py
+++ b/passerelle/base/migrations/0015_auto_20190921_0347.py
@@ -4,8 +4,6 @@ from __future__ import unicode_literals
 
 from django.db import migrations, models
 
-import passerelle.base.models
-
 
 class Migration(migrations.Migration):
 
diff --git a/passerelle/base/models.py b/passerelle/base/models.py
index 9dc02283..6be5925b 100644
--- a/passerelle/base/models.py
+++ b/passerelle/base/models.py
@@ -12,7 +12,6 @@ import traceback
 import uuid
 from contextlib import contextmanager
 
-from django import VERSION
 from django.apps import apps
 from django.conf import settings
 from django.contrib.contenttypes import fields
diff --git a/passerelle/base/views.py b/passerelle/base/views.py
index 1e3bff97..35d56f8e 100644
--- a/passerelle/base/views.py
+++ b/passerelle/base/views.py
@@ -18,7 +18,6 @@ import datetime
 import json
 
 from dateutil import parser as date_parser
-from django.conf import settings
 from django.contrib.contenttypes.models import ContentType
 from django.core.exceptions import ObjectDoesNotExist, PermissionDenied
 from django.db.models import Q
diff --git a/passerelle/contrib/fake_family/models.py b/passerelle/contrib/fake_family/models.py
index f90ba5b9..cfa8953b 100644
--- a/passerelle/contrib/fake_family/models.py
+++ b/passerelle/contrib/fake_family/models.py
@@ -16,7 +16,6 @@
 
 from django.contrib.postgres.fields import JSONField
 from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
-from django.urls import reverse
 from django.utils.translation import ugettext_lazy as _
 
 from passerelle.base.models import BaseResource
diff --git a/passerelle/contrib/fake_family/urls.py b/passerelle/contrib/fake_family/urls.py
index 9087e2d1..250c5339 100644
--- a/passerelle/contrib/fake_family/urls.py
+++ b/passerelle/contrib/fake_family/urls.py
@@ -14,7 +14,7 @@
 # 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/>.
 
-from django.conf.urls import include, url
+from django.conf.urls import url
 
 from .views import *
 
diff --git a/passerelle/contrib/gdema/migrations/0002_auto_20181119_1446.py b/passerelle/contrib/gdema/migrations/0002_auto_20181119_1446.py
index bca910bd..efc2aa2a 100644
--- a/passerelle/contrib/gdema/migrations/0002_auto_20181119_1446.py
+++ b/passerelle/contrib/gdema/migrations/0002_auto_20181119_1446.py
@@ -2,7 +2,7 @@
 # Generated by Django 1.11.12 on 2018-11-19 13:46
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/contrib/greco/models.py b/passerelle/contrib/greco/models.py
index 33fe19d7..02c4571b 100644
--- a/passerelle/contrib/greco/models.py
+++ b/passerelle/contrib/greco/models.py
@@ -22,7 +22,6 @@ from email.mime.text import MIMEText
 import suds.sudsobject
 from django.core.cache import cache
 from django.db import models
-from django.utils import six
 from django.utils.translation import ugettext_lazy as _
 from suds.client import Client
 from suds.transport import Reply
diff --git a/passerelle/contrib/iparapheur/migrations/0002_auto_20160406_1123.py b/passerelle/contrib/iparapheur/migrations/0002_auto_20160406_1123.py
index 3e6703e9..0b54b04d 100644
--- a/passerelle/contrib/iparapheur/migrations/0002_auto_20160406_1123.py
+++ b/passerelle/contrib/iparapheur/migrations/0002_auto_20160406_1123.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import unicode_literals
 
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/contrib/iws/models.py b/passerelle/contrib/iws/models.py
index 6e07b722..64e59805 100644
--- a/passerelle/contrib/iws/models.py
+++ b/passerelle/contrib/iws/models.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
 from datetime import datetime
 
 import lxml.etree
diff --git a/passerelle/contrib/mdph13/models.py b/passerelle/contrib/mdph13/models.py
index dbeff402..13414564 100644
--- a/passerelle/contrib/mdph13/models.py
+++ b/passerelle/contrib/mdph13/models.py
@@ -21,9 +21,8 @@ import re
 
 import requests
 from django.db import models, transaction
-from django.utils import dateparse, six
+from django.utils import six
 from django.utils.six.moves.urllib import parse as urlparse
-from django.utils.timezone import now
 from django.utils.translation import ugettext_lazy as _
 
 from passerelle.base.models import BaseResource, HTTPResource
diff --git a/passerelle/contrib/nancypoll/models.py b/passerelle/contrib/nancypoll/models.py
index 27a724cd..4202ca42 100644
--- a/passerelle/contrib/nancypoll/models.py
+++ b/passerelle/contrib/nancypoll/models.py
@@ -1,6 +1,5 @@
 import csv
 
-from django.core.exceptions import ObjectDoesNotExist
 from django.db import models
 from django.utils import six
 from django.utils.encoding import force_text
diff --git a/passerelle/contrib/solis_apa/models.py b/passerelle/contrib/solis_apa/models.py
index 2b06a542..385821ba 100644
--- a/passerelle/contrib/solis_apa/models.py
+++ b/passerelle/contrib/solis_apa/models.py
@@ -19,8 +19,6 @@ import re
 
 from django.core.cache import cache
 from django.db import models
-from django.http import HttpResponse
-from django.urls import reverse
 from django.utils.six.moves.urllib import parse as urlparse
 from django.utils.translation import ugettext_lazy as _
 
diff --git a/passerelle/contrib/solis_apa/urls.py b/passerelle/contrib/solis_apa/urls.py
index 670fbb21..c73a9879 100644
--- a/passerelle/contrib/solis_apa/urls.py
+++ b/passerelle/contrib/solis_apa/urls.py
@@ -14,7 +14,7 @@
 # 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/>.
 
-from django.conf.urls import include, url
+from django.conf.urls import url
 
 from .views import *
 
diff --git a/passerelle/contrib/teamnet_axel/migrations/0002_management_billing_regies.py b/passerelle/contrib/teamnet_axel/migrations/0002_management_billing_regies.py
index da504a9f..e8b7e8d8 100644
--- a/passerelle/contrib/teamnet_axel/migrations/0002_management_billing_regies.py
+++ b/passerelle/contrib/teamnet_axel/migrations/0002_management_billing_regies.py
@@ -2,7 +2,7 @@
 from __future__ import unicode_literals
 
 import django.contrib.postgres.fields.jsonb
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/contrib/toulouse_smart/migrations/0007_drop_wcs_form_api_url_pk.py b/passerelle/contrib/toulouse_smart/migrations/0007_drop_wcs_form_api_url_pk.py
index e544cbb9..69737c27 100644
--- a/passerelle/contrib/toulouse_smart/migrations/0007_drop_wcs_form_api_url_pk.py
+++ b/passerelle/contrib/toulouse_smart/migrations/0007_drop_wcs_form_api_url_pk.py
@@ -2,7 +2,6 @@
 
 import uuid
 
-import django.db.models.deletion
 from django.db import migrations, models
 
 
diff --git a/passerelle/contrib/toulouse_smart/migrations/0008_recreate_wscrequest_fk.py b/passerelle/contrib/toulouse_smart/migrations/0008_recreate_wscrequest_fk.py
index 12414edc..e649d3d7 100644
--- a/passerelle/contrib/toulouse_smart/migrations/0008_recreate_wscrequest_fk.py
+++ b/passerelle/contrib/toulouse_smart/migrations/0008_recreate_wscrequest_fk.py
@@ -1,7 +1,5 @@
 # Generated by Django 2.2.24 on 2022-03-17 13:36
 
-import uuid
-
 import django.db.models.deletion
 from django.db import migrations, models
 
diff --git a/passerelle/contrib/toulouse_smart/migrations/0011_rename_fk.py b/passerelle/contrib/toulouse_smart/migrations/0011_rename_fk.py
index 8c87ccde..0dd0dee0 100644
--- a/passerelle/contrib/toulouse_smart/migrations/0011_rename_fk.py
+++ b/passerelle/contrib/toulouse_smart/migrations/0011_rename_fk.py
@@ -1,7 +1,6 @@
 # Generated by Django 2.2.24 on 2022-03-17 13:52
 
-import django.db.models.deletion
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
diff --git a/passerelle/plugins.py b/passerelle/plugins.py
index 9826a5a5..4dbd0f22 100644
--- a/passerelle/plugins.py
+++ b/passerelle/plugins.py
@@ -17,7 +17,7 @@
 from django.apps import apps
 from django.conf.urls import include, url
 
-from .urls_utils import app_enabled, decorated_includes, manager_required, required, trust_required
+from .urls_utils import app_enabled, manager_required, required, trust_required
 
 
 def register_apps_urls(urlpatterns):
diff --git a/passerelle/sms/models.py b/passerelle/sms/models.py
index a3f1733b..64cf5768 100644
--- a/passerelle/sms/models.py
+++ b/passerelle/sms/models.py
@@ -26,7 +26,6 @@ from django.utils.module_loading import import_string
 from django.utils.translation import ugettext_lazy as _
 
 from passerelle.base.models import BaseResource
-from passerelle.compat import json_loads
 from passerelle.sms.forms import SMSConnectorForm
 from passerelle.utils.api import endpoint
 from passerelle.utils.jsonresponse import APIError
diff --git a/passerelle/sms/views.py b/passerelle/sms/views.py
index 05ab2b15..9ad41d3d 100644
--- a/passerelle/sms/views.py
+++ b/passerelle/sms/views.py
@@ -1,6 +1,5 @@
 import datetime
 
-from django.apps import apps
 from django.contrib import messages
 from django.db.models import Count
 from django.db.models.functions import TruncDay
diff --git a/passerelle/utils/__init__.py b/passerelle/utils/__init__.py
index 07984fb1..310fe3a5 100644
--- a/passerelle/utils/__init__.py
+++ b/passerelle/utils/__init__.py
@@ -29,7 +29,6 @@ from django.core.cache import cache
 from django.core.exceptions import PermissionDenied
 from django.db import transaction
 from django.http import HttpResponse, HttpResponseBadRequest
-from django.template import Context, Template
 from django.utils.decorators import available_attrs
 from django.utils.encoding import force_bytes, force_text
 from django.utils.functional import lazy
diff --git a/passerelle/utils/api.py b/passerelle/utils/api.py
index 9f7b5277..d4302511 100644
--- a/passerelle/utils/api.py
+++ b/passerelle/utils/api.py
@@ -23,7 +23,7 @@ from django.utils import six
 from django.utils.safestring import mark_safe
 
 # make APIError available from this module
-from .jsonresponse import APIError  # noqa
+from .jsonresponse import APIError  # noqa pylint: disable=unused-import
 
 
 class endpoint(object):
diff --git a/passerelle/utils/conversion.py b/passerelle/utils/conversion.py
index 6cd0fa89..2666a29f 100644
--- a/passerelle/utils/conversion.py
+++ b/passerelle/utils/conversion.py
@@ -22,7 +22,7 @@ import warnings
 
 import unidecode
 from django.utils import six
-from django.utils.encoding import force_str, force_text
+from django.utils.encoding import force_text
 from django.utils.six import BytesIO
 from PIL import Image
 
diff --git a/passerelle/utils/jsonresponse.py b/passerelle/utils/jsonresponse.py
index 7191fe68..b3ccd7d9 100644
--- a/passerelle/utils/jsonresponse.py
+++ b/passerelle/utils/jsonresponse.py
@@ -9,7 +9,6 @@ import functools
 import json
 import logging
 import re
-import sys
 import time
 
 from django.conf import settings
@@ -17,7 +16,6 @@ from django.core.exceptions import ObjectDoesNotExist, PermissionDenied
 from django.core.serializers.json import DjangoJSONEncoder
 from django.http import Http404, HttpResponse, HttpResponseBadRequest
 from django.http.response import HttpResponseBase
-from django.utils import six
 from django.utils.encoding import force_text
 from django.utils.log import log_response
 from requests import HTTPError, RequestException
diff --git a/tests/test_actesweb.py b/tests/test_actesweb.py
index b22954bb..68e53275 100644
--- a/tests/test_actesweb.py
+++ b/tests/test_actesweb.py
@@ -19,11 +19,9 @@ from __future__ import unicode_literals
 import io
 import json
 import os
-import shutil
 import stat
 
 import pytest
-from django.utils import six
 
 import tests.utils
 from passerelle.apps.actesweb.models import ActesWeb
diff --git a/tests/test_api_access.py b/tests/test_api_access.py
index e3bd5417..c1a0eb6e 100644
--- a/tests/test_api_access.py
+++ b/tests/test_api_access.py
@@ -1,16 +1,10 @@
-import re
-import sys
-
 import pytest
-from django.contrib.auth.models import User
 from django.contrib.contenttypes.models import ContentType
-from django.test import override_settings
 from django.urls import reverse
 
-import tests.utils
 from passerelle.apps.oxyd.models import OxydSMSGateway
 from passerelle.base import signature
-from passerelle.base.models import AccessRight, ApiUser, ResourceLog
+from passerelle.base.models import AccessRight, ApiUser
 
 pytestmark = pytest.mark.django_db
 
diff --git a/tests/test_arcgis.py b/tests/test_arcgis.py
index 95c9ccde..e7922041 100644
--- a/tests/test_arcgis.py
+++ b/tests/test_arcgis.py
@@ -5,7 +5,6 @@ import json
 
 import mock
 import pytest
-from django.contrib.auth.models import User
 from django.contrib.contenttypes.models import ContentType
 from django.core.exceptions import ValidationError
 
diff --git a/tests/test_astech.py b/tests/test_astech.py
index 74bf1b02..1d52b1d0 100644
--- a/tests/test_astech.py
+++ b/tests/test_astech.py
@@ -24,7 +24,6 @@ from requests.exceptions import ConnectionError
 
 import tests.utils
 from passerelle.apps.astech.models import ASTech
-from passerelle.utils.jsonresponse import APIError
 
 
 @pytest.fixture
diff --git a/tests/test_astre_rest.py b/tests/test_astre_rest.py
index cb3814eb..5e09138b 100644
--- a/tests/test_astre_rest.py
+++ b/tests/test_astre_rest.py
@@ -7,7 +7,6 @@ from django.contrib.contenttypes.models import ContentType
 
 from passerelle.apps.astre_rest.models import AstreREST
 from passerelle.base.models import AccessRight, ApiUser
-from passerelle.utils.jsonresponse import APIError
 
 
 @pytest.fixture()
diff --git a/tests/test_cartads_cs.py b/tests/test_cartads_cs.py
index f741c4b0..f1d2b145 100644
--- a/tests/test_cartads_cs.py
+++ b/tests/test_cartads_cs.py
@@ -7,7 +7,6 @@ from collections import OrderedDict
 
 import mock
 import pytest
-from django.core.files.storage import default_storage
 from django.test import override_settings
 from httmock import HTTMock
 
diff --git a/tests/test_cityweb.py b/tests/test_cityweb.py
index 854e3260..882ec06e 100644
--- a/tests/test_cityweb.py
+++ b/tests/test_cityweb.py
@@ -20,9 +20,7 @@ import json
 import os
 import shutil
 import stat
-import zipfile
 
-import mock
 import pytest
 from django.core.files.storage import default_storage
 from lxml import etree
diff --git a/tests/test_fake_family.py b/tests/test_fake_family.py
index adc344c0..7db20910 100644
--- a/tests/test_fake_family.py
+++ b/tests/test_fake_family.py
@@ -1,7 +1,5 @@
 # -*- coding: utf-8 -*-
 
-import json
-
 import pytest
 from django.urls import reverse
 
diff --git a/tests/test_generic_endpoint.py b/tests/test_generic_endpoint.py
index a080e8bc..399801b9 100644
--- a/tests/test_generic_endpoint.py
+++ b/tests/test_generic_endpoint.py
@@ -25,21 +25,13 @@ import warnings
 
 import mock
 import pytest
-from django.contrib.contenttypes.models import ContentType
 from django.urls import reverse
 
 import tests.utils
 from passerelle.apps.api_particulier.models import APIParticulier
 from passerelle.apps.arcgis.models import ArcGIS
 from passerelle.apps.mdel.models import MDEL
-from passerelle.base.models import (
-    BaseResource,
-    HTTPResource,
-    LoggingParameters,
-    ProxyLogger,
-    ResourceLog,
-    ResourceStatus,
-)
+from passerelle.base.models import BaseResource, LoggingParameters, ProxyLogger, ResourceLog, ResourceStatus
 from passerelle.contrib.stub_invoices.models import StubInvoicesConnector
 from passerelle.utils.api import endpoint
 from tests.test_manager import login
diff --git a/tests/test_gesbac.py b/tests/test_gesbac.py
index 63fe5a15..682dd5be 100644
--- a/tests/test_gesbac.py
+++ b/tests/test_gesbac.py
@@ -16,13 +16,11 @@
 # 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 pytest
-from django.utils.encoding import force_bytes, force_str, force_text
+from django.utils.encoding import force_bytes, force_text
 from django.utils.timezone import now
 
-from passerelle.apps.gesbac.models import Form, Gesbac
+from passerelle.apps.gesbac.models import Gesbac
 from passerelle.utils import SFTP
 from tests.utils import make_resource
 
diff --git a/tests/test_iparapheur.py b/tests/test_iparapheur.py
index eea87172..fd6aa742 100644
--- a/tests/test_iparapheur.py
+++ b/tests/test_iparapheur.py
@@ -1,6 +1,5 @@
 # -*- coding: utf-8 -*-
 
-import base64
 import os
 import uuid
 import xml.etree.ElementTree as ET
diff --git a/tests/test_isere_ens.py b/tests/test_isere_ens.py
index 7e84b161..36feb2e9 100644
--- a/tests/test_isere_ens.py
+++ b/tests/test_isere_ens.py
@@ -16,16 +16,12 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-import json
-import os
-
 import mock
 import pytest
 from django.urls import reverse
 
 import tests.utils
 from passerelle.contrib.isere_ens.models import API_VERSION, IsereENS
-from passerelle.utils.jsonresponse import APIError
 
 
 @pytest.fixture
diff --git a/tests/test_jobs.py b/tests/test_jobs.py
index 10e6edb7..74d40870 100644
--- a/tests/test_jobs.py
+++ b/tests/test_jobs.py
@@ -11,7 +11,12 @@ from django.core.management import call_command
 import tests.utils
 from passerelle.base.models import Job, ResourceLog, SkipJob
 from passerelle.utils.jsonresponse import APIError
-from tests.test_base_adresse import StreetModel, base_adresse
+from tests.test_base_adresse import BaseAdresse, StreetModel
+
+
+@pytest.fixture
+def base_adresse(db):
+    return tests.utils.setup_access_rights(BaseAdresse.objects.create(slug='base-adresse', zipcode='73'))
 
 
 @mock.patch('passerelle.utils.Request.get')
diff --git a/tests/test_jsondatastore.py b/tests/test_jsondatastore.py
index a8d541ce..316d4e70 100644
--- a/tests/test_jsondatastore.py
+++ b/tests/test_jsondatastore.py
@@ -4,7 +4,7 @@ import pytest
 from django.contrib.contenttypes.models import ContentType
 from django.core.serializers.json import DjangoJSONEncoder
 
-from passerelle.apps.jsondatastore.models import JsonData, JsonDataStore
+from passerelle.apps.jsondatastore.models import JsonDataStore
 from passerelle.base.models import AccessRight, ApiUser
 
 
diff --git a/tests/test_lille_kimoce.py b/tests/test_lille_kimoce.py
index 34acd0b6..9b14b342 100644
--- a/tests/test_lille_kimoce.py
+++ b/tests/test_lille_kimoce.py
@@ -17,7 +17,6 @@
 
 
 import json
-import os
 
 import mock
 import pytest
diff --git a/tests/test_maelis.py b/tests/test_maelis.py
index 1036e5cf..704a0f7a 100644
--- a/tests/test_maelis.py
+++ b/tests/test_maelis.py
@@ -16,7 +16,6 @@ from passerelle.apps.maelis.utils import (
     month_range,
     week_boundaries_datetimes,
 )
-from passerelle.utils.jsonresponse import APIError
 
 pytestmark = pytest.mark.django_db
 
diff --git a/tests/test_opendatasoft.py b/tests/test_opendatasoft.py
index 12aa52f7..a828da5e 100644
--- a/tests/test_opendatasoft.py
+++ b/tests/test_opendatasoft.py
@@ -19,7 +19,6 @@ import json
 
 import mock
 import pytest
-from django.contrib.auth.models import User
 from requests.exceptions import ConnectionError
 
 import tests.utils
diff --git a/tests/test_opengis.py b/tests/test_opengis.py
index bfee1afe..8120e2f5 100644
--- a/tests/test_opengis.py
+++ b/tests/test_opengis.py
@@ -2,7 +2,6 @@ import json
 
 import mock
 import pytest
-from django.contrib.auth.models import User
 from django.core.management import call_command
 
 import tests.utils
diff --git a/tests/test_phonecalls.py b/tests/test_phonecalls.py
index 2689fc83..3e842384 100644
--- a/tests/test_phonecalls.py
+++ b/tests/test_phonecalls.py
@@ -1,5 +1,3 @@
-import re
-
 import pytest
 from django.contrib.contenttypes.models import ContentType
 from django.utils.timezone import now, timedelta
diff --git a/tests/test_photon.py b/tests/test_photon.py
index e2c47fb2..8b50c0ae 100644
--- a/tests/test_photon.py
+++ b/tests/test_photon.py
@@ -19,7 +19,6 @@ import json
 
 import mock
 import pytest
-from django.core.management import call_command
 from httmock import HTTMock, remember_called, response, urlmatch
 from requests.exceptions import ConnectionError, HTTPError
 
diff --git a/tests/test_requests.py b/tests/test_requests.py
index e1d5f70c..53deb6be 100644
--- a/tests/test_requests.py
+++ b/tests/test_requests.py
@@ -8,7 +8,6 @@ from django.test import override_settings
 from httmock import HTTMock, response, urlmatch
 from urllib3.exceptions import ReadTimeoutError
 
-import tests.utils
 from passerelle.utils import CaseInsensitiveDict, Request, log_http_request
 from passerelle.utils.http_authenticators import HawkAuth
 from tests.utils import FakedResponse
diff --git a/tests/test_sms.py b/tests/test_sms.py
index 33855fc0..1d77799a 100644
--- a/tests/test_sms.py
+++ b/tests/test_sms.py
@@ -16,14 +16,11 @@
 import json
 import logging
 
-import isodate
 import mock
 import pytest
-from django.conf import settings
 from django.contrib.contenttypes.models import ContentType
 from django.urls import reverse
 from django.utils.translation import ugettext as _
-from requests import RequestException
 
 import tests.utils
 from passerelle.apps.choosit.models import ChoositSMSGateway
diff --git a/tests/test_strasbourg_eu.py b/tests/test_strasbourg_eu.py
index 91e779f4..ce801e27 100644
--- a/tests/test_strasbourg_eu.py
+++ b/tests/test_strasbourg_eu.py
@@ -2,7 +2,7 @@
 
 import pytest
 from django.contrib.contenttypes.models import ContentType
-from httmock import HTTMock, all_requests
+from httmock import HTTMock
 
 import tests.utils
 from passerelle.base.models import AccessRight, ApiUser
-- 
2.34.1

