From a86d1156c1d3fdc91ae972f211032f5e72bb4a41 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laur=C3=A9line=20Gu=C3=A9rin?= <zebuline@entrouvert.com>
Date: Thu, 1 Apr 2021 16:47:57 +0200
Subject: [PATCH 01/18] misc: pylint on tests (#52630)

---
 pylint.rc                                  | 64 +++++++++++++++++++++-
 tests/__init__.py                          |  0
 tests/admin_pages/test_all.py              |  3 +-
 tests/admin_pages/test_api_access.py       |  2 +-
 tests/admin_pages/test_block.py            |  2 +-
 tests/admin_pages/test_card.py             |  2 +-
 tests/admin_pages/test_carddefcategory.py  |  2 +-
 tests/admin_pages/test_category.py         |  2 +-
 tests/admin_pages/test_datasource.py       |  2 +-
 tests/admin_pages/test_form.py             |  2 +-
 tests/admin_pages/test_logged_errors.py    |  2 +-
 tests/admin_pages/test_role.py             |  2 +-
 tests/admin_pages/test_settings.py         |  2 +-
 tests/admin_pages/test_user.py             |  2 +-
 tests/admin_pages/test_workflow.py         |  2 +-
 tests/admin_pages/test_wscall.py           |  2 +-
 tests/api/test_access.py                   |  3 +-
 tests/api/test_all.py                      |  3 +-
 tests/api/test_carddef.py                  |  2 +-
 tests/api/test_category.py                 |  2 +-
 tests/api/test_custom_view.py              |  2 +-
 tests/api/test_formdata.py                 |  2 +-
 tests/api/test_formdef.py                  |  2 +-
 tests/api/test_user.py                     |  2 +-
 tests/api/test_utils.py                    |  3 +-
 tests/api/test_workflow.py                 |  2 +-
 tests/backoffice_pages/test_all.py         |  3 +-
 tests/backoffice_pages/test_carddata.py    |  2 +-
 tests/backoffice_pages/test_custom_view.py |  2 +-
 tests/backoffice_pages/test_export.py      |  2 +-
 tests/backoffice_pages/test_submission.py  |  2 +-
 tests/conftest.py                          |  3 +-
 tests/form_pages/test_all.py               |  3 +-
 tests/form_pages/test_block.py             |  2 +-
 tests/form_pages/test_formdata.py          |  2 +-
 tests/test_auth_pages.py                   |  3 +-
 tests/test_carddef.py                      |  3 +-
 tests/test_categories.py                   |  3 +-
 tests/test_convert_to_sql.py               |  3 +-
 tests/test_ctl.py                          |  3 +-
 tests/test_datasource.py                   |  5 +-
 tests/test_datasource_chrono.py            |  3 +-
 tests/test_ezt.py                          |  3 +-
 tests/test_fc_auth.py                      |  3 +-
 tests/test_fields.py                       |  3 +-
 tests/test_formdata.py                     |  3 +-
 tests/test_formdef.py                      |  3 +-
 tests/test_formdef_import.py               |  3 +-
 tests/test_hobo.py                         |  3 +-
 tests/test_hobo_notify.py                  |  3 +-
 tests/test_mail_templates.py               |  3 +-
 tests/test_misc.py                         |  3 +-
 tests/test_prefill.py                      |  3 +-
 tests/test_publisher.py                    |  3 +-
 tests/test_register.py                     |  3 +-
 tests/test_role.py                         |  3 +-
 tests/test_rootdirectory.py                |  3 +-
 tests/test_saml2utils.py                   |  3 +-
 tests/test_saml_auth.py                    |  5 +-
 tests/test_sessions.py                     |  3 +-
 tests/test_snapshots.py                    |  5 +-
 tests/test_sql.py                          |  3 +-
 tests/test_storage.py                      |  3 +-
 tests/test_templates.py                    |  3 +-
 tests/test_texts.py                        |  3 +-
 tests/test_tracking_code.py                |  3 +-
 tests/test_upload_storage.py               |  3 +-
 tests/test_users.py                        |  3 +-
 tests/test_variadic_url.py                 |  3 +-
 tests/test_widgets.py                      |  3 +-
 tests/test_workflow_import.py              |  3 +-
 tests/test_workflows.py                    |  3 +-
 tests/test_wscall.py                       |  3 +-
 tox.ini                                    |  2 +-
 74 files changed, 183 insertions(+), 76 deletions(-)
 create mode 100644 tests/__init__.py

diff --git a/pylint.rc b/pylint.rc
index a0dafdc1..303cb003 100644
--- a/pylint.rc
+++ b/pylint.rc
@@ -6,7 +6,69 @@ cache-size=500
 init-hook="import sys, os; sys.path.append("wcs")'
 
 [MESSAGES CONTROL]
-disable=abstract-method,arguments-differ,assignment-from-no-return,assignment-from-none,attribute-defined-outside-init,broad-except,consider-using-dict-comprehension,consider-using-set-comprehension,consider-using-ternary,cyclic-import,deprecated-module,duplicate-code,duplicate-except,eval-used,exec-used,fixme,global-variable-undefined,import-outside-toplevel,inconsistent-return-statements,invalid-name,keyword-arg-before-vararg,len-as-condition,missing-class-docstring,missing-function-docstring,missing-module-docstring,no-else-return,no-member,no-self-use,non-parent-init-called,not-a-mapping,not-callable,possibly-unused-variable,protected-access,raise-missing-from,redefined-argument-from-local,redefined-builtin,redefined-outer-name,signature-differs,stop-iteration-return,subprocess-run-check,super-init-not-called,superfluous-parens,too-many-ancestors,too-many-arguments,too-many-boolean-expressions,too-many-branches,too-many-function-args,too-many-instance-attributes,too-many-lines,too-many-locals,too-many-nested-blocks,too-many-public-methods,too-many-return-statements,too-many-statements,undefined-loop-variable,unnecessary-comprehension,unnecessary-lambda,unsubscriptable-object,unsupported-membership-test,unused-argument
+disable=
+    abstract-method,
+    arguments-differ,
+    assignment-from-no-return,
+    assignment-from-none,
+    attribute-defined-outside-init,
+    broad-except,
+    consider-using-dict-comprehension,
+    consider-using-set-comprehension,
+    consider-using-ternary,
+    cyclic-import,
+    deprecated-module,
+    disallowed-name,
+    duplicate-code,
+    duplicate-except,
+    eval-used,
+    exec-used,
+    fixme,
+    global-variable-undefined,
+    import-outside-toplevel,
+    inconsistent-return-statements,
+    invalid-name,
+    keyword-arg-before-vararg,
+    len-as-condition,
+    missing-class-docstring,
+    missing-function-docstring,
+    missing-module-docstring,
+    no-else-return,
+    no-member,
+    no-self-use,
+    non-parent-init-called,
+    not-a-mapping,
+    not-callable,
+    pointless-statement,
+    possibly-unused-variable,
+    protected-access,
+    raise-missing-from,
+    redefined-argument-from-local,
+    redefined-builtin,
+    redefined-outer-name,
+    signature-differs,
+    stop-iteration-return,
+    subprocess-run-check,
+    super-init-not-called,
+    superfluous-parens,
+    too-many-ancestors,
+    too-many-arguments,
+    too-many-boolean-expressions,
+    too-many-branches,
+    too-many-function-args,
+    too-many-instance-attributes,
+    too-many-lines,
+    too-many-locals,
+    too-many-nested-blocks,
+    too-many-public-methods,
+    too-many-return-statements,
+    too-many-statements,
+    undefined-loop-variable,
+    unnecessary-comprehension,
+    unnecessary-lambda,
+    unsubscriptable-object,
+    unsupported-membership-test,
+    unused-argument
 
 
 [REPORTS]
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/tests/admin_pages/test_all.py b/tests/admin_pages/test_all.py
index 6c4e918f..bc8d1dde 100644
--- a/tests/admin_pages/test_all.py
+++ b/tests/admin_pages/test_all.py
@@ -3,11 +3,12 @@
 import os
 
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs.qommon.http_request import HTTPRequest
 from wcs.qommon.ident.password_accounts import PasswordAccount
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
+
 
 def pytest_generate_tests(metafunc):
     if 'pub' in metafunc.fixturenames:
diff --git a/tests/admin_pages/test_api_access.py b/tests/admin_pages/test_api_access.py
index 522c05e7..ba16e37d 100644
--- a/tests/admin_pages/test_api_access.py
+++ b/tests/admin_pages/test_api_access.py
@@ -15,11 +15,11 @@
 # along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs.api_access import ApiAccess
 from wcs.qommon.http_request import HTTPRequest
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_superuser
 
 
diff --git a/tests/admin_pages/test_block.py b/tests/admin_pages/test_block.py
index f2afb06f..81502515 100644
--- a/tests/admin_pages/test_block.py
+++ b/tests/admin_pages/test_block.py
@@ -8,7 +8,6 @@ except ImportError:
     lasso = None
 
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from webtest import Upload
 
 from wcs import fields
@@ -16,6 +15,7 @@ from wcs.blocks import BlockDef
 from wcs.formdef import FormDef
 from wcs.qommon.http_request import HTTPRequest
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_role, create_superuser
 
 
diff --git a/tests/admin_pages/test_card.py b/tests/admin_pages/test_card.py
index 43e4d1a7..55397123 100644
--- a/tests/admin_pages/test_card.py
+++ b/tests/admin_pages/test_card.py
@@ -3,7 +3,6 @@
 import re
 
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs import fields
 from wcs.admin.settings import UserFieldsFormDef
@@ -14,6 +13,7 @@ from wcs.qommon.http_request import HTTPRequest
 from wcs.wf.form import FormWorkflowStatusItem, WorkflowFormFieldsFormDef
 from wcs.workflows import Workflow, WorkflowBackofficeFieldsFormDef, WorkflowVariablesFieldsFormDef
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_superuser
 
 
diff --git a/tests/admin_pages/test_carddefcategory.py b/tests/admin_pages/test_carddefcategory.py
index 19f5936b..a23fe7e5 100644
--- a/tests/admin_pages/test_carddefcategory.py
+++ b/tests/admin_pages/test_carddefcategory.py
@@ -1,12 +1,12 @@
 # -*- coding: utf-8 -*-
 
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs.carddef import CardDef
 from wcs.categories import CardDefCategory
 from wcs.qommon.http_request import HTTPRequest
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_superuser
 
 
diff --git a/tests/admin_pages/test_category.py b/tests/admin_pages/test_category.py
index 2cdcd752..c3df9086 100644
--- a/tests/admin_pages/test_category.py
+++ b/tests/admin_pages/test_category.py
@@ -1,12 +1,12 @@
 # -*- coding: utf-8 -*-
 
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs.categories import Category
 from wcs.formdef import FormDef
 from wcs.qommon.http_request import HTTPRequest
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_superuser
 
 
diff --git a/tests/admin_pages/test_datasource.py b/tests/admin_pages/test_datasource.py
index 2c265b0e..20a708c0 100644
--- a/tests/admin_pages/test_datasource.py
+++ b/tests/admin_pages/test_datasource.py
@@ -13,7 +13,6 @@ except ImportError:
     lasso = None
 
 import pytest
-from utilities import HttpRequestsMocking, clean_temporary_pub, create_temporary_pub, get_app, login
 from webtest import Upload
 
 from wcs import fields
@@ -24,6 +23,7 @@ from wcs.formdef import FormDef
 from wcs.qommon.http_request import HTTPRequest
 from wcs.workflows import Workflow, WorkflowBackofficeFieldsFormDef
 
+from ..utilities import HttpRequestsMocking, clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_superuser
 
 
diff --git a/tests/admin_pages/test_form.py b/tests/admin_pages/test_form.py
index 97bd184e..f129b04d 100644
--- a/tests/admin_pages/test_form.py
+++ b/tests/admin_pages/test_form.py
@@ -10,7 +10,6 @@ import xml.etree.ElementTree as ET
 
 import mock
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from webtest import Upload
 
 from wcs import fields
@@ -23,6 +22,7 @@ from wcs.qommon.http_request import HTTPRequest
 from wcs.workflows import Workflow
 from wcs.wscalls import NamedWsCall
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_role, create_superuser
 
 
diff --git a/tests/admin_pages/test_logged_errors.py b/tests/admin_pages/test_logged_errors.py
index 38af15fc..5109c1c8 100644
--- a/tests/admin_pages/test_logged_errors.py
+++ b/tests/admin_pages/test_logged_errors.py
@@ -3,13 +3,13 @@
 import datetime
 
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs.carddef import CardDef
 from wcs.formdef import FormDef
 from wcs.qommon.http_request import HTTPRequest
 from wcs.workflows import Workflow
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_superuser
 
 
diff --git a/tests/admin_pages/test_role.py b/tests/admin_pages/test_role.py
index d4fb401a..6a99a727 100644
--- a/tests/admin_pages/test_role.py
+++ b/tests/admin_pages/test_role.py
@@ -1,11 +1,11 @@
 # -*- coding: utf-8 -*-
 
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs.formdef import FormDef
 from wcs.qommon.http_request import HTTPRequest
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_superuser
 
 
diff --git a/tests/admin_pages/test_settings.py b/tests/admin_pages/test_settings.py
index 286b5ef4..2f94a2c7 100644
--- a/tests/admin_pages/test_settings.py
+++ b/tests/admin_pages/test_settings.py
@@ -14,7 +14,6 @@ except ImportError:
 import mock
 import pytest
 from quixote.http_request import Upload as QuixoteUpload
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from webtest import Upload
 
 from wcs import fields
@@ -30,6 +29,7 @@ from wcs.wf.export_to_model import ExportToModel
 from wcs.workflows import CommentableWorkflowStatusItem, Workflow
 from wcs.wscalls import NamedWsCall
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_superuser
 
 
diff --git a/tests/admin_pages/test_user.py b/tests/admin_pages/test_user.py
index efb6f35c..d45f90ff 100644
--- a/tests/admin_pages/test_user.py
+++ b/tests/admin_pages/test_user.py
@@ -1,13 +1,13 @@
 # -*- coding: utf-8 -*-
 
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs import fields
 from wcs.admin.settings import UserFieldsFormDef
 from wcs.qommon.http_request import HTTPRequest
 from wcs.qommon.ident.password_accounts import PasswordAccount
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_role, create_superuser
 
 
diff --git a/tests/admin_pages/test_workflow.py b/tests/admin_pages/test_workflow.py
index 6d3620f6..601d667d 100644
--- a/tests/admin_pages/test_workflow.py
+++ b/tests/admin_pages/test_workflow.py
@@ -13,7 +13,6 @@ except ImportError:
 
 import pytest
 from quixote.http_request import Upload as QuixoteUpload
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from webtest import Upload
 
 from wcs import fields
@@ -45,6 +44,7 @@ from wcs.workflows import (
     item_classes,
 )
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_superuser
 
 
diff --git a/tests/admin_pages/test_wscall.py b/tests/admin_pages/test_wscall.py
index 9e51e110..f96f12d6 100644
--- a/tests/admin_pages/test_wscall.py
+++ b/tests/admin_pages/test_wscall.py
@@ -4,12 +4,12 @@ import io
 import xml.etree.ElementTree as ET
 
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from webtest import Upload
 
 from wcs.qommon.http_request import HTTPRequest
 from wcs.wscalls import NamedWsCall
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_superuser
 
 
diff --git a/tests/api/test_access.py b/tests/api/test_access.py
index fd0b32c9..4a0300e2 100644
--- a/tests/api/test_access.py
+++ b/tests/api/test_access.py
@@ -11,13 +11,14 @@ import urllib.parse
 import pytest
 from django.utils.encoding import force_bytes
 from quixote import get_publisher
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs.api_utils import get_secret_and_orig, is_url_signed, sign_url
 from wcs.qommon.errors import AccessForbiddenError
 from wcs.qommon.http_request import HTTPRequest
 from wcs.qommon.ident.password_accounts import PasswordAccount
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
+
 
 def pytest_generate_tests(metafunc):
     if 'pub' in metafunc.fixturenames:
diff --git a/tests/api/test_all.py b/tests/api/test_all.py
index c9287f5f..57d309e7 100644
--- a/tests/api/test_all.py
+++ b/tests/api/test_all.py
@@ -7,13 +7,14 @@ import os
 import mock
 import pytest
 from quixote import get_publisher
-from utilities import clean_temporary_pub, create_temporary_pub, get_app
 
 from wcs.api_utils import sign_url
 from wcs.formdef import FormDef
 from wcs.qommon.afterjobs import AfterJob
 from wcs.qommon.http_request import HTTPRequest
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app
+
 
 def pytest_generate_tests(metafunc):
     if 'pub' in metafunc.fixturenames:
diff --git a/tests/api/test_carddef.py b/tests/api/test_carddef.py
index 2fac97de..1732ae6b 100644
--- a/tests/api/test_carddef.py
+++ b/tests/api/test_carddef.py
@@ -11,7 +11,6 @@ import mock
 import pytest
 from django.utils.encoding import force_text
 from quixote import get_publisher
-from utilities import clean_temporary_pub, create_temporary_pub, get_app
 
 from wcs import fields, qommon
 from wcs.api_utils import sign_url
@@ -23,6 +22,7 @@ from wcs.qommon.http_request import HTTPRequest
 from wcs.qommon.upload_storage import PicklableUpload
 from wcs.workflows import Workflow, WorkflowBackofficeFieldsFormDef
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app
 from .utils import sign_uri
 
 
diff --git a/tests/api/test_category.py b/tests/api/test_category.py
index 00d7b4df..65647684 100644
--- a/tests/api/test_category.py
+++ b/tests/api/test_category.py
@@ -4,12 +4,12 @@ import os
 
 import pytest
 from quixote import get_publisher
-from utilities import clean_temporary_pub, create_temporary_pub, get_app
 
 from wcs.categories import Category
 from wcs.formdef import FormDef
 from wcs.qommon.http_request import HTTPRequest
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app
 from .utils import sign_uri
 
 
diff --git a/tests/api/test_custom_view.py b/tests/api/test_custom_view.py
index 1dc91fa1..1544fed6 100644
--- a/tests/api/test_custom_view.py
+++ b/tests/api/test_custom_view.py
@@ -7,7 +7,6 @@ import zipfile
 
 import pytest
 from quixote import get_publisher
-from utilities import clean_temporary_pub, create_temporary_pub, get_app
 
 from wcs import fields
 from wcs.carddef import CardDef
@@ -15,6 +14,7 @@ from wcs.formdef import FormDef
 from wcs.qommon import ods
 from wcs.qommon.http_request import HTTPRequest
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app
 from .utils import sign_uri
 
 
diff --git a/tests/api/test_formdata.py b/tests/api/test_formdata.py
index 3aa1eb62..51b70255 100644
--- a/tests/api/test_formdata.py
+++ b/tests/api/test_formdata.py
@@ -12,7 +12,6 @@ import zipfile
 import pytest
 from django.utils.encoding import force_bytes
 from quixote import get_publisher
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs import fields
 from wcs.blocks import BlockDef
@@ -25,6 +24,7 @@ from wcs.qommon.ident.password_accounts import PasswordAccount
 from wcs.qommon.upload_storage import PicklableUpload
 from wcs.workflows import EditableWorkflowStatusItem, Workflow, WorkflowBackofficeFieldsFormDef
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .utils import sign_uri
 
 
diff --git a/tests/api/test_formdef.py b/tests/api/test_formdef.py
index fe34f4c9..dfe0c61a 100644
--- a/tests/api/test_formdef.py
+++ b/tests/api/test_formdef.py
@@ -12,7 +12,6 @@ import mock
 import pytest
 from django.utils.encoding import force_text
 from quixote import get_publisher
-from utilities import clean_temporary_pub, create_temporary_pub, get_app
 
 from wcs import fields, qommon
 from wcs.api_utils import sign_url
@@ -23,6 +22,7 @@ from wcs.qommon.upload_storage import PicklableUpload
 from wcs.wf.jump import JumpWorkflowStatusItem
 from wcs.workflows import Workflow, WorkflowBackofficeFieldsFormDef
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app
 from .utils import sign_uri
 
 
diff --git a/tests/api/test_user.py b/tests/api/test_user.py
index ed8859b7..77411a59 100644
--- a/tests/api/test_user.py
+++ b/tests/api/test_user.py
@@ -5,7 +5,6 @@ import os
 
 import pytest
 from quixote import get_publisher
-from utilities import clean_temporary_pub, create_temporary_pub, get_app
 
 from wcs import fields
 from wcs.admin.settings import UserFieldsFormDef
@@ -15,6 +14,7 @@ from wcs.qommon.ident.password_accounts import PasswordAccount
 from wcs.qommon.upload_storage import PicklableUpload
 from wcs.workflows import Workflow, WorkflowVariablesFieldsFormDef
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app
 from .utils import sign_uri
 
 
diff --git a/tests/api/test_utils.py b/tests/api/test_utils.py
index 00503a7b..9c91bb41 100644
--- a/tests/api/test_utils.py
+++ b/tests/api/test_utils.py
@@ -1,11 +1,12 @@
 import pytest
 from quixote import cleanup, get_response
-from utilities import clean_temporary_pub, create_temporary_pub
 
 from wcs import sessions
 from wcs.api_utils import get_query_flag
 from wcs.qommon.http_request import HTTPRequest
 
+from ..utilities import clean_temporary_pub, create_temporary_pub
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/api/test_workflow.py b/tests/api/test_workflow.py
index f431747b..cc52c8f0 100644
--- a/tests/api/test_workflow.py
+++ b/tests/api/test_workflow.py
@@ -4,7 +4,6 @@ import os
 
 import pytest
 from quixote import get_publisher
-from utilities import clean_temporary_pub, create_temporary_pub, get_app
 
 from wcs import fields
 from wcs.formdef import FormDef
@@ -14,6 +13,7 @@ from wcs.wf.jump import JumpWorkflowStatusItem
 from wcs.wf.register_comment import RegisterCommenterWorkflowStatusItem
 from wcs.workflows import Workflow
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app
 from .utils import sign_uri
 
 
diff --git a/tests/backoffice_pages/test_all.py b/tests/backoffice_pages/test_all.py
index 23fc24ed..63772251 100644
--- a/tests/backoffice_pages/test_all.py
+++ b/tests/backoffice_pages/test_all.py
@@ -13,7 +13,6 @@ import mock
 import pytest
 from quixote import get_publisher
 from quixote.http_request import Upload as QuixoteUpload
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 import wcs.qommon.storage as st
 from wcs import fields
@@ -48,6 +47,8 @@ from wcs.workflows import (
 )
 from wcs.wscalls import NamedWsCall
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
+
 
 def pytest_generate_tests(metafunc):
     if 'pub' in metafunc.fixturenames:
diff --git a/tests/backoffice_pages/test_carddata.py b/tests/backoffice_pages/test_carddata.py
index bb7bd9c2..c40e7a8a 100644
--- a/tests/backoffice_pages/test_carddata.py
+++ b/tests/backoffice_pages/test_carddata.py
@@ -4,7 +4,6 @@ import os
 import uuid
 
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from webtest import Upload
 
 from wcs import fields
@@ -16,6 +15,7 @@ from wcs.qommon.http_request import HTTPRequest
 from wcs.wf.wscall import WebserviceCallStatusItem
 from wcs.workflows import ChoiceWorkflowStatusItem, Workflow
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_user
 
 
diff --git a/tests/backoffice_pages/test_custom_view.py b/tests/backoffice_pages/test_custom_view.py
index 120ee650..929799c6 100644
--- a/tests/backoffice_pages/test_custom_view.py
+++ b/tests/backoffice_pages/test_custom_view.py
@@ -4,7 +4,6 @@ import re
 
 import pytest
 from quixote import get_publisher
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs import fields
 from wcs.carddef import CardDef
@@ -12,6 +11,7 @@ from wcs.formdef import FormDef
 from wcs.qommon.http_request import HTTPRequest
 from wcs.qommon.ident.password_accounts import PasswordAccount
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_superuser, create_user
 
 
diff --git a/tests/backoffice_pages/test_export.py b/tests/backoffice_pages/test_export.py
index 94898ad1..587d142a 100644
--- a/tests/backoffice_pages/test_export.py
+++ b/tests/backoffice_pages/test_export.py
@@ -9,7 +9,6 @@ import xml.etree.ElementTree as ET
 import zipfile
 
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs import fields
 from wcs.blocks import BlockDef
@@ -18,6 +17,7 @@ from wcs.qommon import ods
 from wcs.qommon.http_request import HTTPRequest
 from wcs.qommon.upload_storage import PicklableUpload
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_superuser
 
 
diff --git a/tests/backoffice_pages/test_submission.py b/tests/backoffice_pages/test_submission.py
index 453e2984..74cf60e0 100644
--- a/tests/backoffice_pages/test_submission.py
+++ b/tests/backoffice_pages/test_submission.py
@@ -6,7 +6,6 @@ import time
 import urllib.parse
 
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs import fields
 from wcs.api_utils import sign_url
@@ -18,6 +17,7 @@ from wcs.wf.jump import JumpWorkflowStatusItem
 from wcs.wf.redirect_to_url import RedirectToUrlWorkflowStatusItem
 from wcs.workflows import Workflow, WorkflowBackofficeFieldsFormDef
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_superuser, create_user
 
 
diff --git a/tests/conftest.py b/tests/conftest.py
index 06c24e23..ad67910f 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -2,7 +2,8 @@ import configparser
 import os
 
 import pytest
-from utilities import EmailsMocking, HttpRequestsMocking, SMSMocking
+
+from .utilities import EmailsMocking, HttpRequestsMocking, SMSMocking
 
 
 def site_options(request, pub, section, variable, value):
diff --git a/tests/form_pages/test_all.py b/tests/form_pages/test_all.py
index fbd4ade0..37195572 100644
--- a/tests/form_pages/test_all.py
+++ b/tests/form_pages/test_all.py
@@ -20,7 +20,6 @@ except ImportError:
     Image = None
 
 from django.utils.encoding import force_bytes, force_text
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs import fields
 from wcs.blocks import BlockDef
@@ -53,6 +52,8 @@ from wcs.workflows import (
     WorkflowVariablesFieldsFormDef,
 )
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
+
 
 def assert_equal_zip(stream1, stream2):
     z1 = zipfile.ZipFile(stream1)
diff --git a/tests/form_pages/test_block.py b/tests/form_pages/test_block.py
index 6262bd06..197e3853 100644
--- a/tests/form_pages/test_block.py
+++ b/tests/form_pages/test_block.py
@@ -5,7 +5,6 @@ import json
 
 import mock
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from webtest import Upload
 
 from wcs import fields
@@ -16,6 +15,7 @@ from wcs.formdef import FormDef
 from wcs.wf.form import FormWorkflowStatusItem, WorkflowFormFieldsFormDef
 from wcs.workflows import Workflow
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_user
 
 
diff --git a/tests/form_pages/test_formdata.py b/tests/form_pages/test_formdata.py
index 0a6e907d..7e176738 100644
--- a/tests/form_pages/test_formdata.py
+++ b/tests/form_pages/test_formdata.py
@@ -13,7 +13,6 @@ import mock
 import pytest
 from django.utils.encoding import force_bytes
 from quixote.http_request import Upload as QuixoteUpload
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from webtest import Hidden, Upload
 
 from wcs import fields
@@ -33,6 +32,7 @@ from wcs.workflows import (
 )
 from wcs.wscalls import NamedWsCall
 
+from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from .test_all import create_user, create_user_and_admin
 
 
diff --git a/tests/test_auth_pages.py b/tests/test_auth_pages.py
index b246e1aa..bdb3b976 100644
--- a/tests/test_auth_pages.py
+++ b/tests/test_auth_pages.py
@@ -1,10 +1,11 @@
 import http.cookies
 
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs.qommon.ident.password_accounts import PasswordAccount
 
+from .utilities import clean_temporary_pub, create_temporary_pub, get_app, login
+
 
 @pytest.fixture
 def pub():
diff --git a/tests/test_carddef.py b/tests/test_carddef.py
index 7a48619b..a7eb6c7a 100644
--- a/tests/test_carddef.py
+++ b/tests/test_carddef.py
@@ -2,7 +2,6 @@ import io
 import xml.etree.ElementTree as ET
 
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub
 
 from wcs.carddef import CardDef
 from wcs.categories import CardDefCategory
@@ -11,6 +10,8 @@ from wcs.qommon.http_request import HTTPRequest
 from wcs.qommon.misc import indent_xml as indent
 from wcs.qommon.template import Template
 
+from .utilities import clean_temporary_pub, create_temporary_pub
+
 
 def pytest_generate_tests(metafunc):
     if 'pub' in metafunc.fixturenames:
diff --git a/tests/test_categories.py b/tests/test_categories.py
index 5dd0fc6c..78e8be3b 100644
--- a/tests/test_categories.py
+++ b/tests/test_categories.py
@@ -5,10 +5,11 @@ import shutil
 
 import pytest
 from quixote import cleanup
-from utilities import create_temporary_pub
 
 from wcs.categories import CardDefCategory, Category
 
+from .utilities import create_temporary_pub
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/test_convert_to_sql.py b/tests/test_convert_to_sql.py
index 124a3614..3aaa40af 100644
--- a/tests/test_convert_to_sql.py
+++ b/tests/test_convert_to_sql.py
@@ -7,12 +7,13 @@ import pytest
 from django.core.management import call_command, get_commands
 from django.core.management.base import CommandError
 from quixote import get_publisher
-from utilities import clean_temporary_pub, create_temporary_pub, force_connections_close
 
 from wcs.fields import BoolField
 from wcs.formdef import FormDef
 from wcs.sql import cleanup_connection
 
+from .utilities import clean_temporary_pub, create_temporary_pub, force_connections_close
+
 
 @pytest.fixture
 def formdeffix():
diff --git a/tests/test_ctl.py b/tests/test_ctl.py
index f8fbe5a8..b2dab8de 100644
--- a/tests/test_ctl.py
+++ b/tests/test_ctl.py
@@ -7,7 +7,6 @@ from email.mime.text import MIMEText
 import psycopg2
 import pytest
 from django.core.management import CommandError, call_command
-from utilities import clean_temporary_pub, create_temporary_pub
 
 import wcs.qommon.ctl
 from wcs.ctl.delete_tenant import CmdDeleteTenant
@@ -26,6 +25,8 @@ from wcs.sql import cleanup_connection, get_connection_and_cursor
 from wcs.wf.jump import JumpWorkflowStatusItem
 from wcs.workflows import Workflow, WorkflowStatusItem
 
+from .utilities import clean_temporary_pub, create_temporary_pub
+
 
 @pytest.fixture
 def pub():
diff --git a/tests/test_datasource.py b/tests/test_datasource.py
index 82b8db22..6347bc0b 100644
--- a/tests/test_datasource.py
+++ b/tests/test_datasource.py
@@ -8,14 +8,15 @@ import urllib.parse
 
 import mock
 import pytest
-from test_widgets import MockHtmlForm, mock_form_submission
-from utilities import clean_temporary_pub, create_temporary_pub
 
 from wcs import data_sources, fields
 from wcs.data_sources import NamedDataSource, register_data_source_function
 from wcs.qommon.form import Form, get_request
 from wcs.qommon.http_request import HTTPRequest
 
+from .test_widgets import MockHtmlForm, mock_form_submission
+from .utilities import clean_temporary_pub, create_temporary_pub
+
 
 def pytest_generate_tests(metafunc):
     if 'pub' in metafunc.fixturenames:
diff --git a/tests/test_datasource_chrono.py b/tests/test_datasource_chrono.py
index 6e576982..8d51b242 100644
--- a/tests/test_datasource_chrono.py
+++ b/tests/test_datasource_chrono.py
@@ -7,7 +7,6 @@ import shutil
 import mock
 import pytest
 from quixote import cleanup
-from utilities import create_temporary_pub
 
 from wcs import fields
 from wcs.data_sources import NamedDataSource, build_agenda_datasources, collect_agenda_data
@@ -15,6 +14,8 @@ from wcs.formdef import FormDef
 from wcs.qommon.http_request import HTTPRequest
 from wcs.qommon.misc import ConnectionError
 
+from .utilities import create_temporary_pub
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/test_ezt.py b/tests/test_ezt.py
index 15955c5b..4756b7fa 100644
--- a/tests/test_ezt.py
+++ b/tests/test_ezt.py
@@ -4,7 +4,6 @@ import os
 
 import pytest
 from quixote import cleanup
-from utilities import clean_temporary_pub, create_temporary_pub, get_app
 
 from wcs.qommon.ezt import (
     ArgCountSyntaxError,
@@ -16,6 +15,8 @@ from wcs.qommon.ezt import (
 )
 from wcs.scripts import ScriptsSubstitutionProxy
 
+from .utilities import clean_temporary_pub, create_temporary_pub, get_app
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/test_fc_auth.py b/tests/test_fc_auth.py
index 3ecee450..6285c978 100644
--- a/tests/test_fc_auth.py
+++ b/tests/test_fc_auth.py
@@ -5,7 +5,8 @@ import urllib.parse
 import mock
 from django.utils.encoding import force_bytes, force_text
 from quixote import cleanup, get_session_manager
-from utilities import create_temporary_pub, get_app
+
+from .utilities import create_temporary_pub, get_app
 
 PROFILE = {
     'fields': [
diff --git a/tests/test_fields.py b/tests/test_fields.py
index a4aff58e..f7e83214 100644
--- a/tests/test_fields.py
+++ b/tests/test_fields.py
@@ -7,7 +7,6 @@ import pytest
 from bs4 import BeautifulSoup
 from quixote import cleanup
 from quixote.http_request import Upload
-from utilities import MockSubstitutionVariables, create_temporary_pub
 
 from wcs import fields
 from wcs.formdef import FormDef
@@ -17,6 +16,8 @@ from wcs.qommon.http_request import HTTPRequest
 from wcs.qommon.upload_storage import PicklableUpload
 from wcs.variables import LazyFormData
 
+from .utilities import MockSubstitutionVariables, create_temporary_pub
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/test_formdata.py b/tests/test_formdata.py
index 328b8d42..a1c6b3ca 100644
--- a/tests/test_formdata.py
+++ b/tests/test_formdata.py
@@ -8,7 +8,6 @@ import mock
 import pytest
 from quixote import get_publisher
 from quixote.http_request import Upload
-from utilities import clean_temporary_pub, create_temporary_pub
 
 from wcs import fields, formdef, sessions
 from wcs.blocks import BlockDef
@@ -31,6 +30,8 @@ from wcs.workflows import (
     WorkflowStatusItem,
 )
 
+from .utilities import clean_temporary_pub, create_temporary_pub
+
 
 def pytest_generate_tests(metafunc):
     if 'pub' in metafunc.fixturenames:
diff --git a/tests/test_formdef.py b/tests/test_formdef.py
index a9449fd4..c89f9fbf 100644
--- a/tests/test_formdef.py
+++ b/tests/test_formdef.py
@@ -11,7 +11,6 @@ import time
 import pytest
 from django.utils.encoding import force_bytes
 from quixote import cleanup
-from utilities import clean_temporary_pub, create_temporary_pub
 
 from wcs import fields
 from wcs.blocks import BlockDef
@@ -22,6 +21,8 @@ from wcs.qommon.upload_storage import PicklableUpload
 from wcs.wf.form import FormWorkflowStatusItem, WorkflowFormFieldsFormDef
 from wcs.workflows import AttachmentEvolutionPart, Workflow, WorkflowBackofficeFieldsFormDef
 
+from .utilities import clean_temporary_pub, create_temporary_pub
+
 
 def pytest_generate_tests(metafunc):
     if 'pub' in metafunc.fixturenames:
diff --git a/tests/test_formdef_import.py b/tests/test_formdef_import.py
index ad7b2008..222afa9d 100644
--- a/tests/test_formdef_import.py
+++ b/tests/test_formdef_import.py
@@ -7,7 +7,6 @@ import xml.etree.ElementTree as ET
 
 import pytest
 from quixote import cleanup
-from utilities import create_temporary_pub
 
 from wcs.carddef import CardDef
 from wcs.categories import Category
@@ -15,6 +14,8 @@ from wcs.formdef import FormDef, FormdefImportError, fields
 from wcs.qommon.misc import indent_xml as indent
 from wcs.workflows import Workflow
 
+from .utilities import create_temporary_pub
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/test_hobo.py b/tests/test_hobo.py
index 6723728f..b0fee029 100644
--- a/tests/test_hobo.py
+++ b/tests/test_hobo.py
@@ -12,13 +12,14 @@ import urllib.parse
 import mock
 import pytest
 from quixote import cleanup
-from utilities import clean_temporary_pub, create_temporary_pub
 
 from wcs import fields, sql
 from wcs.ctl.check_hobos import CmdCheckHobos
 from wcs.publisher import WcsPublisher
 from wcs.qommon import force_str
 
+from .utilities import clean_temporary_pub, create_temporary_pub
+
 HOBO_JSON = {
     'services': [
         {
diff --git a/tests/test_hobo_notify.py b/tests/test_hobo_notify.py
index b4d913fe..e73b0283 100644
--- a/tests/test_hobo_notify.py
+++ b/tests/test_hobo_notify.py
@@ -2,13 +2,14 @@
 import uuid
 
 import pytest
-from utilities import create_temporary_pub
 
 from wcs.ctl.hobo_notify import CmdHoboNotify
 from wcs.qommon import force_str
 from wcs.qommon import storage as st
 from wcs.qommon.http_request import HTTPRequest
 
+from .utilities import create_temporary_pub
+
 
 def pytest_generate_tests(metafunc):
     if 'pub' in metafunc.fixturenames:
diff --git a/tests/test_mail_templates.py b/tests/test_mail_templates.py
index dac434ce..25ef120e 100644
--- a/tests/test_mail_templates.py
+++ b/tests/test_mail_templates.py
@@ -8,7 +8,6 @@ import xml.etree.ElementTree as ET
 import pytest
 from django.utils.encoding import force_bytes
 from quixote import cleanup
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from webtest import Upload
 
 from wcs.fields import FileField
@@ -19,6 +18,8 @@ from wcs.qommon.ident.password_accounts import PasswordAccount
 from wcs.qommon.upload_storage import PicklableUpload
 from wcs.workflows import SendmailWorkflowStatusItem, Workflow
 
+from .utilities import clean_temporary_pub, create_temporary_pub, get_app, login
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/test_misc.py b/tests/test_misc.py
index d3d5e07b..f6ec8e5a 100644
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -15,7 +15,6 @@ import pytest
 from django.core.cache import cache
 from django.utils import translation
 from quixote import cleanup
-from utilities import clean_temporary_pub, create_temporary_pub, get_app
 
 import wcs.api  # workaround against circular dependencies :/
 import wcs.qommon.storage
@@ -43,6 +42,8 @@ from wcs.scripts import Script
 from wcs.wf.jump import JumpWorkflowStatusItem
 from wcs.workflows import Workflow
 
+from .utilities import clean_temporary_pub, create_temporary_pub, get_app
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/test_prefill.py b/tests/test_prefill.py
index 07de3cfc..f4935823 100644
--- a/tests/test_prefill.py
+++ b/tests/test_prefill.py
@@ -3,12 +3,13 @@ import shutil
 
 import pytest
 from quixote import cleanup, get_request
-from utilities import create_temporary_pub
 
 from wcs import fields
 from wcs.carddef import CardDef
 from wcs.qommon.http_request import HTTPRequest
 
+from .utilities import create_temporary_pub
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/test_publisher.py b/tests/test_publisher.py
index 5fd80dc8..fd096aaa 100644
--- a/tests/test_publisher.py
+++ b/tests/test_publisher.py
@@ -19,13 +19,14 @@ from django.http import Http404
 from django.test import override_settings
 from django.utils.encoding import force_text
 from quixote import cleanup
-from utilities import create_temporary_pub
 
 from wcs.qommon import get_publisher_class
 from wcs.qommon.afterjobs import AfterJob
 from wcs.qommon.cron import CronJob
 from wcs.qommon.http_request import HTTPRequest
 
+from .utilities import create_temporary_pub
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/test_register.py b/tests/test_register.py
index 761e8488..430b5413 100644
--- a/tests/test_register.py
+++ b/tests/test_register.py
@@ -6,12 +6,13 @@ import shutil
 
 import pytest
 from quixote import cleanup
-from utilities import clean_temporary_pub, create_temporary_pub, get_app
 
 from wcs.qommon import force_str
 from wcs.qommon.http_request import HTTPRequest
 from wcs.qommon.ident.password_accounts import PasswordAccount
 
+from .utilities import clean_temporary_pub, create_temporary_pub, get_app
+
 
 def pytest_generate_tests(metafunc):
     if 'pub' in metafunc.fixturenames:
diff --git a/tests/test_role.py b/tests/test_role.py
index 3c4f36f4..4dc3e7bc 100644
--- a/tests/test_role.py
+++ b/tests/test_role.py
@@ -3,10 +3,11 @@
 import pickle
 
 from quixote import get_publisher
-from utilities import clean_temporary_pub, create_temporary_pub
 
 from wcs.roles import get_user_roles
 
+from .utilities import clean_temporary_pub, create_temporary_pub
+
 
 def setup_module(module):
     pub = create_temporary_pub()
diff --git a/tests/test_rootdirectory.py b/tests/test_rootdirectory.py
index 04fb25ec..decb65d9 100644
--- a/tests/test_rootdirectory.py
+++ b/tests/test_rootdirectory.py
@@ -4,7 +4,6 @@ import sys
 
 import pytest
 from quixote import cleanup
-from utilities import create_temporary_pub, get_app
 
 import wcs.forms.root
 from wcs import formdef
@@ -13,6 +12,8 @@ from wcs.formdef import FormDef
 from wcs.qommon import sessions
 from wcs.qommon.http_request import HTTPRequest
 
+from .utilities import create_temporary_pub, get_app
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/test_saml2utils.py b/tests/test_saml2utils.py
index 9ca5bd8a..322b87aa 100644
--- a/tests/test_saml2utils.py
+++ b/tests/test_saml2utils.py
@@ -1,11 +1,12 @@
 import shutil
 
 from quixote import cleanup
-from utilities import create_temporary_pub
 
 from wcs.qommon import x509utils
 from wcs.qommon.saml2utils import Metadata
 
+from .utilities import create_temporary_pub
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/test_saml_auth.py b/tests/test_saml_auth.py
index 3e290c2d..59b837a0 100644
--- a/tests/test_saml_auth.py
+++ b/tests/test_saml_auth.py
@@ -13,8 +13,6 @@ except ImportError:
 import pytest
 from quixote import cleanup, get_session, get_session_manager
 from quixote.errors import RequestError
-from test_hobo_notify import PROFILE
-from utilities import clean_temporary_pub, create_temporary_pub, get_app
 
 from wcs.qommon import sessions, x509utils
 from wcs.qommon.http_request import HTTPRequest
@@ -22,6 +20,9 @@ from wcs.qommon.ident.idp import AdminIDPDir, MethodAdminDirectory
 from wcs.qommon.misc import get_lasso_server
 from wcs.qommon.saml2 import Saml2Directory
 
+from .test_hobo_notify import PROFILE
+from .utilities import clean_temporary_pub, create_temporary_pub, get_app
+
 pytestmark = pytest.mark.skipif('lasso is None')
 
 IDP_METADATA = """<?xml version="1.0"?>
diff --git a/tests/test_sessions.py b/tests/test_sessions.py
index c13d310e..f2bc8488 100644
--- a/tests/test_sessions.py
+++ b/tests/test_sessions.py
@@ -5,13 +5,14 @@ import time
 
 import pytest
 from quixote import cleanup
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs import fields
 from wcs.formdef import FormDef
 from wcs.qommon.http_request import HTTPRequest
 from wcs.qommon.ident.password_accounts import PasswordAccount
 
+from .utilities import clean_temporary_pub, create_temporary_pub, get_app, login
+
 
 def setup_module():
     clean_temporary_pub()
diff --git a/tests/test_snapshots.py b/tests/test_snapshots.py
index 111dd226..2796c91c 100644
--- a/tests/test_snapshots.py
+++ b/tests/test_snapshots.py
@@ -4,9 +4,7 @@ import shutil
 import xml.etree.ElementTree as ET
 
 import pytest
-from admin_pages.test_all import create_role, create_superuser
 from quixote.http_request import Upload
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 from wcs.blocks import BlockDef
 from wcs.carddef import CardDef
@@ -20,6 +18,9 @@ from wcs.wf.form import FormWorkflowStatusItem, WorkflowFormFieldsFormDef
 from wcs.workflows import Workflow
 from wcs.wscalls import NamedWsCall
 
+from .admin_pages.test_all import create_role, create_superuser
+from .utilities import clean_temporary_pub, create_temporary_pub, get_app, login
+
 
 @pytest.fixture
 def pub(request, emails):
diff --git a/tests/test_sql.py b/tests/test_sql.py
index 0feb5079..73708450 100644
--- a/tests/test_sql.py
+++ b/tests/test_sql.py
@@ -13,7 +13,6 @@ import time
 import pytest
 from django.core.management import call_command
 from quixote import cleanup
-from utilities import clean_temporary_pub, create_temporary_pub
 
 import wcs.qommon.storage as st
 from wcs import fields, publisher, sql
@@ -24,6 +23,8 @@ from wcs.wf.jump import JumpWorkflowStatusItem
 from wcs.wf.register_comment import RegisterCommenterWorkflowStatusItem
 from wcs.workflows import CommentableWorkflowStatusItem, Workflow, WorkflowCriticalityLevel
 
+from .utilities import clean_temporary_pub, create_temporary_pub
+
 postgresql = pytest.mark.postgresql
 
 try:
diff --git a/tests/test_storage.py b/tests/test_storage.py
index 706e96a9..ff0d2606 100644
--- a/tests/test_storage.py
+++ b/tests/test_storage.py
@@ -6,13 +6,14 @@ import time
 
 import pytest
 from quixote import cleanup
-from utilities import create_temporary_pub
 
 import wcs.qommon.storage as st
 from wcs.carddef import CardDef
 from wcs.formdef import FormDef
 from wcs.qommon.storage import StorableObject, cache_umask
 
+from .utilities import create_temporary_pub
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/test_templates.py b/tests/test_templates.py
index 2c3509a4..908d60db 100644
--- a/tests/test_templates.py
+++ b/tests/test_templates.py
@@ -13,7 +13,6 @@ except ImportError:
 
 from django.test import override_settings
 from django.utils.timezone import now
-from utilities import clean_temporary_pub, create_temporary_pub
 
 from wcs import fields
 from wcs.formdef import FormDef
@@ -22,6 +21,8 @@ from wcs.qommon.substitution import CompatibilityNamesDict
 from wcs.qommon.template import Template, TemplateError
 from wcs.variables import LazyFormData
 
+from .utilities import clean_temporary_pub, create_temporary_pub
+
 
 @pytest.fixture
 def pub():
diff --git a/tests/test_texts.py b/tests/test_texts.py
index 6b410116..cc37511f 100644
--- a/tests/test_texts.py
+++ b/tests/test_texts.py
@@ -2,11 +2,12 @@ import shutil
 import sys
 
 from quixote import cleanup
-from utilities import MockSubstitutionVariables, create_temporary_pub
 
 from wcs.qommon.admin.texts import TextsDirectory
 from wcs.qommon.http_request import HTTPRequest
 
+from .utilities import MockSubstitutionVariables, create_temporary_pub
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/test_tracking_code.py b/tests/test_tracking_code.py
index b5409c9c..6594eca8 100644
--- a/tests/test_tracking_code.py
+++ b/tests/test_tracking_code.py
@@ -1,8 +1,9 @@
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub
 
 from wcs.formdef import FormDef
 
+from .utilities import clean_temporary_pub, create_temporary_pub
+
 
 def pytest_generate_tests(metafunc):
     if 'pub' in metafunc.fixturenames:
diff --git a/tests/test_upload_storage.py b/tests/test_upload_storage.py
index 1f2a6595..0850acb2 100644
--- a/tests/test_upload_storage.py
+++ b/tests/test_upload_storage.py
@@ -5,7 +5,6 @@ import os
 
 import mock
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 from webtest import Upload
 
 from wcs import fields
@@ -14,6 +13,8 @@ from wcs.formdef import FormDef
 from wcs.qommon.ident.password_accounts import PasswordAccount
 from wcs.wf.register_comment import RegisterCommenterWorkflowStatusItem
 
+from .utilities import clean_temporary_pub, create_temporary_pub, get_app, login
+
 
 def pytest_generate_tests(metafunc):
     if 'pub' in metafunc.fixturenames:
diff --git a/tests/test_users.py b/tests/test_users.py
index 8eaa01eb..36345717 100644
--- a/tests/test_users.py
+++ b/tests/test_users.py
@@ -7,11 +7,12 @@ import time
 
 import pytest
 from quixote import cleanup
-from utilities import create_temporary_pub
 
 from wcs import fields, publisher
 from wcs.variables import LazyUser
 
+from .utilities import create_temporary_pub
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/test_variadic_url.py b/tests/test_variadic_url.py
index 5cc4daae..76592a1f 100644
--- a/tests/test_variadic_url.py
+++ b/tests/test_variadic_url.py
@@ -1,9 +1,10 @@
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub
 
 from wcs.qommon.ezt import EZTException
 from wcs.qommon.misc import get_variadic_url
 
+from .utilities import clean_temporary_pub, create_temporary_pub
+
 
 @pytest.fixture
 def pub(request):
diff --git a/tests/test_widgets.py b/tests/test_widgets.py
index 70da6626..137ceac7 100644
--- a/tests/test_widgets.py
+++ b/tests/test_widgets.py
@@ -8,13 +8,14 @@ import mechanize
 import pytest
 from quixote import cleanup, get_response
 from quixote.http_request import parse_query
-from utilities import create_temporary_pub
 
 from wcs.qommon import sessions
 from wcs.qommon.form import *
 from wcs.qommon.http_request import HTTPRequest
 from wcs.wf.profile import ProfileUpdateRowWidget
 
+from .utilities import create_temporary_pub
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/test_workflow_import.py b/tests/test_workflow_import.py
index f10d8bec..1addd2f3 100644
--- a/tests/test_workflow_import.py
+++ b/tests/test_workflow_import.py
@@ -5,7 +5,6 @@ import xml.etree.ElementTree as ET
 
 import pytest
 from quixote.http_request import Upload
-from utilities import clean_temporary_pub, create_temporary_pub
 
 from wcs.carddef import CardDef
 from wcs.fields import FileField, StringField
@@ -39,6 +38,8 @@ from wcs.workflows import (
     WorkflowVariablesFieldsFormDef,
 )
 
+from .utilities import clean_temporary_pub, create_temporary_pub
+
 
 @pytest.fixture
 def pub(request):
diff --git a/tests/test_workflows.py b/tests/test_workflows.py
index 765bc37c..c80a0675 100644
--- a/tests/test_workflows.py
+++ b/tests/test_workflows.py
@@ -19,7 +19,6 @@ except ImportError:
 from django.utils.encoding import force_bytes, force_text
 from quixote import cleanup, get_response
 from quixote.http_request import Upload as QuixoteUpload
-from utilities import MockSubstitutionVariables, clean_temporary_pub, create_temporary_pub
 
 from wcs import sessions
 from wcs.blocks import BlockDef
@@ -88,6 +87,8 @@ from wcs.workflows import (
     perform_items,
 )
 
+from .utilities import MockSubstitutionVariables, clean_temporary_pub, create_temporary_pub
+
 
 def setup_module(module):
     cleanup()
diff --git a/tests/test_wscall.py b/tests/test_wscall.py
index 3c78af5e..c34cd270 100644
--- a/tests/test_wscall.py
+++ b/tests/test_wscall.py
@@ -1,7 +1,6 @@
 import json
 
 import pytest
-from utilities import clean_temporary_pub, create_temporary_pub, get_app
 
 from wcs import fields
 from wcs.formdef import FormDef
@@ -9,6 +8,8 @@ from wcs.qommon.http_request import HTTPRequest
 from wcs.qommon.template import Template
 from wcs.wscalls import NamedWsCall
 
+from .utilities import clean_temporary_pub, create_temporary_pub, get_app
+
 
 @pytest.fixture
 def pub():
diff --git a/tox.ini b/tox.ini
index 54e1b1fd..833fc545 100644
--- a/tox.ini
+++ b/tox.ini
@@ -45,5 +45,5 @@ deps =
     pre-commit
 commands =
     py.test -v {env:COVERAGE:} --junitxml=junit-{envname}.xml {posargs:tests/}
-    pylint: ./pylint.sh wcs/
+    pylint: ./pylint.sh wcs/ tests/
     codestyle: pre-commit run --all-files --show-diff-on-failure
-- 
2.30.2

