From a5e3a84dbdaf304bc0ec191a104e9082b1eb8adb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= <fpeters@entrouvert.com>
Date: Mon, 11 Jul 2022 16:45:37 +0200
Subject: [PATCH 8/8] tests: simplify pub fixtures as sql is the new default
 (#67190)

---
 tests/admin_pages/test_all.py                 |   2 +-
 tests/admin_pages/test_api_access.py          |   2 +-
 tests/admin_pages/test_block.py               |   2 +-
 tests/admin_pages/test_card.py                |  10 +-
 tests/admin_pages/test_carddefcategory.py     |   2 +-
 tests/admin_pages/test_category.py            |   2 +-
 tests/admin_pages/test_datasource.py          |  10 +-
 tests/admin_pages/test_deprecations.py        |   2 +-
 tests/admin_pages/test_form.py                |  10 +-
 tests/admin_pages/test_logged_errors.py       |   2 +-
 tests/admin_pages/test_role.py                |   2 +-
 tests/admin_pages/test_settings.py            |   4 +-
 tests/admin_pages/test_studio.py              |  21 +-
 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                      |  10 +-
 tests/api/test_all.py                         |   4 +-
 tests/api/test_carddef.py                     |   4 +-
 tests/api/test_category.py                    |   4 +-
 tests/api/test_custom_view.py                 |   4 +-
 tests/api/test_export_import.py               |   2 +-
 tests/api/test_formdata.py                    |   4 +-
 tests/api/test_formdef.py                     |   4 +-
 tests/api/test_statistics.py                  |   2 +-
 tests/api/test_user.py                        |   4 +-
 tests/api/test_workflow.py                    |   4 +-
 tests/backoffice_pages/test_all.py            |   4 +-
 tests/backoffice_pages/test_carddata.py       |   4 +-
 tests/backoffice_pages/test_columns.py        |   4 +-
 tests/backoffice_pages/test_custom_view.py    |   4 +-
 tests/backoffice_pages/test_export.py         |   4 +-
 tests/backoffice_pages/test_filters.py        |   4 +-
 tests/backoffice_pages/test_form_inspect.py   |   4 +-
 tests/backoffice_pages/test_sort.py           |   4 +-
 tests/backoffice_pages/test_statistics.py     |   4 +-
 tests/backoffice_pages/test_submission.py     |   4 +-
 .../backoffice_pages/test_workflow_inspect.py |   4 +-
 tests/form_pages/test_all.py                  |  18 +-
 tests/form_pages/test_block.py                |   1 -
 tests/form_pages/test_computed_field.py       |   4 +-
 tests/form_pages/test_file_field.py           |   1 -
 tests/form_pages/test_formdata.py             |   1 -
 tests/form_pages/test_live.py                 |   1 -
 tests/test_auth_pages.py                      |   2 +-
 tests/test_carddef.py                         |   2 +-
 tests/test_categories.py                      |   2 +-
 tests/test_convert_to_sql.py                  |   4 +-
 tests/test_ctl.py                             |  51 +-
 tests/test_datasource.py                      |   2 +-
 tests/test_datasource_users.py                |   2 +-
 tests/test_fc_auth.py                         |   2 +-
 tests/test_formdata.py                        |   4 +-
 tests/test_formdef.py                         |   4 +-
 tests/test_logged_errors.py                   |   2 +-
 tests/test_mail_templates.py                  |   2 +-
 tests/test_publisher.py                       |   4 +-
 tests/test_register.py                        |   2 +-
 tests/test_rootdirectory.py                   |   2 +-
 tests/test_saml_auth.py                       |   4 +-
 tests/test_snapshots.py                       |   7 +-
 tests/test_sql.py                             |   2 +-
 tests/test_token.py                           |   2 +-
 tests/test_tracking_code.py                   |   2 +-
 tests/test_upload_storage.py                  |   1 -
 tests/test_wscall.py                          |   2 +-
 tests/utilities.py                            |  22 +-
 tests/workflow/test_all.py                    | 444 +++++++++---------
 tests/workflow/test_carddata.py               |  86 ++--
 tests/workflow/test_formdata.py               |  52 +-
 tests/workflow/test_notification.py           |  44 +-
 71 files changed, 418 insertions(+), 530 deletions(-)

diff --git a/tests/admin_pages/test_all.py b/tests/admin_pages/test_all.py
index 69a388b52..f46bf3796 100644
--- a/tests/admin_pages/test_all.py
+++ b/tests/admin_pages/test_all.py
@@ -10,7 +10,7 @@ from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, logi
 
 @pytest.fixture
 def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/admin_pages/test_api_access.py b/tests/admin_pages/test_api_access.py
index 3c48acb7a..25d56c935 100644
--- a/tests/admin_pages/test_api_access.py
+++ b/tests/admin_pages/test_api_access.py
@@ -25,7 +25,7 @@ from .test_all import create_superuser
 
 @pytest.fixture
 def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/admin_pages/test_block.py b/tests/admin_pages/test_block.py
index 31763354b..2dbcf5064 100644
--- a/tests/admin_pages/test_block.py
+++ b/tests/admin_pages/test_block.py
@@ -17,7 +17,7 @@ from .test_all import create_role, create_superuser
 
 @pytest.fixture
 def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/admin_pages/test_card.py b/tests/admin_pages/test_card.py
index 41af43669..6b899cdc9 100644
--- a/tests/admin_pages/test_card.py
+++ b/tests/admin_pages/test_card.py
@@ -19,8 +19,9 @@ from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, logi
 from .test_all import create_superuser
 
 
-def pub_fixture(**kwargs):
-    pub = create_temporary_pub(**kwargs)
+@pytest.fixture
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
@@ -31,11 +32,6 @@ def pub_fixture(**kwargs):
     return pub
 
 
-@pytest.fixture
-def pub(request, emails):
-    return pub_fixture(sql_mode=True)
-
-
 def teardown_module(module):
     clean_temporary_pub()
 
diff --git a/tests/admin_pages/test_carddefcategory.py b/tests/admin_pages/test_carddefcategory.py
index f71cce17e..3364a8a70 100644
--- a/tests/admin_pages/test_carddefcategory.py
+++ b/tests/admin_pages/test_carddefcategory.py
@@ -11,7 +11,7 @@ from .test_all import create_superuser
 
 @pytest.fixture
 def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/admin_pages/test_category.py b/tests/admin_pages/test_category.py
index ca481289c..836187518 100644
--- a/tests/admin_pages/test_category.py
+++ b/tests/admin_pages/test_category.py
@@ -10,7 +10,7 @@ from .test_all import create_superuser
 
 @pytest.fixture
 def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/admin_pages/test_datasource.py b/tests/admin_pages/test_datasource.py
index 6e77ae10a..5a222c3a1 100644
--- a/tests/admin_pages/test_datasource.py
+++ b/tests/admin_pages/test_datasource.py
@@ -21,8 +21,9 @@ from ..utilities import HttpRequestsMocking, clean_temporary_pub, create_tempora
 from .test_all import create_superuser
 
 
-def pub_fixture(**kwargs):
-    pub = create_temporary_pub(**kwargs)
+@pytest.fixture
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
@@ -33,11 +34,6 @@ def pub_fixture(**kwargs):
     return pub
 
 
-@pytest.fixture
-def pub(request, emails):
-    return pub_fixture(sql_mode=True)
-
-
 def teardown_module(module):
     clean_temporary_pub()
 
diff --git a/tests/admin_pages/test_deprecations.py b/tests/admin_pages/test_deprecations.py
index 31eb0f810..3b2f59761 100644
--- a/tests/admin_pages/test_deprecations.py
+++ b/tests/admin_pages/test_deprecations.py
@@ -29,7 +29,7 @@ from .test_all import create_superuser
 
 @pytest.fixture
 def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/admin_pages/test_form.py b/tests/admin_pages/test_form.py
index f2ea424d8..e878a7b37 100644
--- a/tests/admin_pages/test_form.py
+++ b/tests/admin_pages/test_form.py
@@ -23,8 +23,9 @@ from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, logi
 from .test_all import create_role, create_superuser
 
 
-def pub_fixture(**kwargs):
-    pub = create_temporary_pub(**kwargs)
+@pytest.fixture
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
@@ -35,11 +36,6 @@ def pub_fixture(**kwargs):
     return pub
 
 
-@pytest.fixture
-def pub(request, emails):
-    return pub_fixture(sql_mode=True)
-
-
 def teardown_module(module):
     clean_temporary_pub()
 
diff --git a/tests/admin_pages/test_logged_errors.py b/tests/admin_pages/test_logged_errors.py
index 723e39338..c9d74406e 100644
--- a/tests/admin_pages/test_logged_errors.py
+++ b/tests/admin_pages/test_logged_errors.py
@@ -13,7 +13,7 @@ from .test_all import create_superuser
 
 @pytest.fixture
 def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
     pub.cfg['identification'] = {'methods': ['password']}
diff --git a/tests/admin_pages/test_role.py b/tests/admin_pages/test_role.py
index e63ff227b..4397bdde5 100644
--- a/tests/admin_pages/test_role.py
+++ b/tests/admin_pages/test_role.py
@@ -9,7 +9,7 @@ from .test_all import create_superuser
 
 @pytest.fixture
 def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/admin_pages/test_settings.py b/tests/admin_pages/test_settings.py
index 458d8a63d..91737ec53 100644
--- a/tests/admin_pages/test_settings.py
+++ b/tests/admin_pages/test_settings.py
@@ -32,8 +32,8 @@ from .test_all import create_superuser
 
 
 @pytest.fixture
-def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+def pub():
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/admin_pages/test_studio.py b/tests/admin_pages/test_studio.py
index 14c2e8b74..3321cd7f9 100644
--- a/tests/admin_pages/test_studio.py
+++ b/tests/admin_pages/test_studio.py
@@ -17,8 +17,9 @@ from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, logi
 from .test_all import create_superuser
 
 
-def pub_fixture(**kwargs):
-    pub = create_temporary_pub(**kwargs)
+@pytest.fixture
+def pub():
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
@@ -29,16 +30,6 @@ def pub_fixture(**kwargs):
     return pub
 
 
-@pytest.fixture
-def pub(request):
-    return pub_fixture(sql_mode=True)
-
-
-@pytest.fixture
-def sql_pub(request):
-    return pub_fixture(sql_mode=True)
-
-
 def teardown_module(module):
     clean_temporary_pub()
 
@@ -98,8 +89,7 @@ def test_studio_home(pub):
     assert '../settings/' not in resp.text
 
 
-def test_studio_home_recent_errors(sql_pub):
-    pub = sql_pub
+def test_studio_home_recent_errors(pub):
     create_superuser(pub)
 
     app = login(get_app(pub))
@@ -135,8 +125,7 @@ def test_studio_home_recent_errors(sql_pub):
     assert 'logged-errors/%s/' % errors[5].id in resp
 
 
-def test_studio_home_recent_changes(sql_pub):
-    pub = sql_pub
+def test_studio_home_recent_changes(pub):
     create_superuser(pub)
 
     BlockDef.wipe()
diff --git a/tests/admin_pages/test_user.py b/tests/admin_pages/test_user.py
index a19822d9a..8c9a189f7 100644
--- a/tests/admin_pages/test_user.py
+++ b/tests/admin_pages/test_user.py
@@ -11,7 +11,7 @@ from .test_all import create_role, create_superuser
 
 @pytest.fixture
 def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/admin_pages/test_workflow.py b/tests/admin_pages/test_workflow.py
index 913f59aad..d60d2465c 100644
--- a/tests/admin_pages/test_workflow.py
+++ b/tests/admin_pages/test_workflow.py
@@ -32,7 +32,7 @@ from .test_all import create_superuser
 
 @pytest.fixture
 def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/admin_pages/test_wscall.py b/tests/admin_pages/test_wscall.py
index efe067a35..1a10245a8 100644
--- a/tests/admin_pages/test_wscall.py
+++ b/tests/admin_pages/test_wscall.py
@@ -13,7 +13,7 @@ from .test_all import create_superuser
 
 @pytest.fixture
 def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/api/test_access.py b/tests/api/test_access.py
index 0ee91d382..ae08ecdaa 100644
--- a/tests/api/test_access.py
+++ b/tests/api/test_access.py
@@ -19,8 +19,8 @@ from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, logi
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
@@ -72,9 +72,9 @@ def admin_user():
     return user
 
 
-@pytest.fixture(params=['sql', 'pickle'])
-def no_request_pub(request):
-    pub = create_temporary_pub(sql_mode=bool(request.param == 'sql'))
+@pytest.fixture
+def no_request_pub():
+    pub = create_temporary_pub()
     pub.app_dir = os.path.join(pub.APP_DIR, 'example.net')
     pub.set_config()
 
diff --git a/tests/api/test_all.py b/tests/api/test_all.py
index 4df7c7a0b..33202ca45 100644
--- a/tests/api/test_all.py
+++ b/tests/api/test_all.py
@@ -15,8 +15,8 @@ from ..utilities import clean_temporary_pub, create_temporary_pub, get_app
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/api/test_carddef.py b/tests/api/test_carddef.py
index b24a66672..d8b0ca76f 100644
--- a/tests/api/test_carddef.py
+++ b/tests/api/test_carddef.py
@@ -28,8 +28,8 @@ from .utils import sign_uri
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/api/test_category.py b/tests/api/test_category.py
index d311f3c03..b45a9863f 100644
--- a/tests/api/test_category.py
+++ b/tests/api/test_category.py
@@ -12,8 +12,8 @@ from .utils import sign_uri
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/api/test_custom_view.py b/tests/api/test_custom_view.py
index d55134267..9f47e9628 100644
--- a/tests/api/test_custom_view.py
+++ b/tests/api/test_custom_view.py
@@ -17,8 +17,8 @@ from .utils import sign_uri
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/api/test_export_import.py b/tests/api/test_export_import.py
index 01adec8a6..450ae3c9b 100644
--- a/tests/api/test_export_import.py
+++ b/tests/api/test_export_import.py
@@ -21,7 +21,7 @@ from .utils import sign_uri
 
 @pytest.fixture
 def pub():
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
     with open(os.path.join(pub.app_dir, 'site-options.cfg'), 'w') as fd:
         fd.write(
             '''\
diff --git a/tests/api/test_formdata.py b/tests/api/test_formdata.py
index f93bab0c9..c2c674c74 100644
--- a/tests/api/test_formdata.py
+++ b/tests/api/test_formdata.py
@@ -30,8 +30,8 @@ from .utils import sign_uri
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/api/test_formdef.py b/tests/api/test_formdef.py
index 95318921b..db445c004 100644
--- a/tests/api/test_formdef.py
+++ b/tests/api/test_formdef.py
@@ -27,8 +27,8 @@ from .utils import sign_uri
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/api/test_statistics.py b/tests/api/test_statistics.py
index 5ec55e39b..cf25d519e 100644
--- a/tests/api/test_statistics.py
+++ b/tests/api/test_statistics.py
@@ -17,7 +17,7 @@ from .utils import sign_uri
 
 @pytest.fixture
 def pub():
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
     BlockDef.wipe()
     Category.wipe()
     FormDef.wipe()
diff --git a/tests/api/test_user.py b/tests/api/test_user.py
index 9d436d734..41b3cf37b 100644
--- a/tests/api/test_user.py
+++ b/tests/api/test_user.py
@@ -20,8 +20,8 @@ from .utils import sign_uri
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/api/test_workflow.py b/tests/api/test_workflow.py
index 3520ca623..634c868c3 100644
--- a/tests/api/test_workflow.py
+++ b/tests/api/test_workflow.py
@@ -17,8 +17,8 @@ from .utils import sign_uri
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/backoffice_pages/test_all.py b/tests/backoffice_pages/test_all.py
index 96ccce2ca..25b492820 100644
--- a/tests/backoffice_pages/test_all.py
+++ b/tests/backoffice_pages/test_all.py
@@ -30,8 +30,8 @@ from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, logi
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/backoffice_pages/test_carddata.py b/tests/backoffice_pages/test_carddata.py
index d4aaab86d..65149c42e 100644
--- a/tests/backoffice_pages/test_carddata.py
+++ b/tests/backoffice_pages/test_carddata.py
@@ -18,8 +18,8 @@ from .test_all import create_superuser, create_user
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/backoffice_pages/test_columns.py b/tests/backoffice_pages/test_columns.py
index a0405e8e1..0246fc279 100644
--- a/tests/backoffice_pages/test_columns.py
+++ b/tests/backoffice_pages/test_columns.py
@@ -17,8 +17,8 @@ from .test_all import create_superuser
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/backoffice_pages/test_custom_view.py b/tests/backoffice_pages/test_custom_view.py
index a2d4c50c3..f304e2e8f 100644
--- a/tests/backoffice_pages/test_custom_view.py
+++ b/tests/backoffice_pages/test_custom_view.py
@@ -15,8 +15,8 @@ from .test_all import create_superuser, create_user
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/backoffice_pages/test_export.py b/tests/backoffice_pages/test_export.py
index c057d470b..656c8a3d2 100644
--- a/tests/backoffice_pages/test_export.py
+++ b/tests/backoffice_pages/test_export.py
@@ -20,8 +20,8 @@ from .test_all import create_superuser
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/backoffice_pages/test_filters.py b/tests/backoffice_pages/test_filters.py
index 6ab17fec1..bd7eee481 100644
--- a/tests/backoffice_pages/test_filters.py
+++ b/tests/backoffice_pages/test_filters.py
@@ -17,8 +17,8 @@ from .test_all import create_environment, create_superuser
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/backoffice_pages/test_form_inspect.py b/tests/backoffice_pages/test_form_inspect.py
index 249835ab2..34543c90d 100644
--- a/tests/backoffice_pages/test_form_inspect.py
+++ b/tests/backoffice_pages/test_form_inspect.py
@@ -19,8 +19,8 @@ from .test_all import create_user
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.cfg['identification'] = {'methods': ['password']}
diff --git a/tests/backoffice_pages/test_sort.py b/tests/backoffice_pages/test_sort.py
index 3872e631e..b33cfbc7c 100644
--- a/tests/backoffice_pages/test_sort.py
+++ b/tests/backoffice_pages/test_sort.py
@@ -16,8 +16,8 @@ from .test_all import create_superuser
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/backoffice_pages/test_statistics.py b/tests/backoffice_pages/test_statistics.py
index 23e6d8f34..66d91428e 100644
--- a/tests/backoffice_pages/test_statistics.py
+++ b/tests/backoffice_pages/test_statistics.py
@@ -11,8 +11,8 @@ from .test_all import create_environment, create_superuser, create_user
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/backoffice_pages/test_submission.py b/tests/backoffice_pages/test_submission.py
index a848d9007..e2139e4bf 100644
--- a/tests/backoffice_pages/test_submission.py
+++ b/tests/backoffice_pages/test_submission.py
@@ -18,8 +18,8 @@ from .test_all import create_superuser, create_user
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/backoffice_pages/test_workflow_inspect.py b/tests/backoffice_pages/test_workflow_inspect.py
index f3ac04004..cc0387509 100644
--- a/tests/backoffice_pages/test_workflow_inspect.py
+++ b/tests/backoffice_pages/test_workflow_inspect.py
@@ -15,8 +15,8 @@ from .test_all import create_superuser
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.cfg['identification'] = {'methods': ['password']}
diff --git a/tests/form_pages/test_all.py b/tests/form_pages/test_all.py
index dfc0a84d7..bee62bb23 100644
--- a/tests/form_pages/test_all.py
+++ b/tests/form_pages/test_all.py
@@ -65,8 +65,9 @@ def pytest_generate_tests(metafunc):
         metafunc.parametrize('pub', ['sql', 'sql-lazy'], indirect=True)
 
 
-def pub_fixture(**kwargs):
-    pub = create_temporary_pub(**kwargs)
+@pytest.fixture
+def pub(request):
+    pub = create_temporary_pub(lazy_mode=bool('lazy' in request.param))
     pub.cfg['identification'] = {'methods': ['password']}
     pub.cfg['language'] = {'language': 'en'}
     pub.write_cfg()
@@ -78,16 +79,6 @@ def pub_fixture(**kwargs):
     return pub
 
 
-@pytest.fixture
-def pub(request, emails):
-    return pub_fixture(sql_mode=bool('sql' in request.param), lazy_mode=bool('lazy' in request.param))
-
-
-@pytest.fixture
-def sql_pub(request, emails):
-    return pub_fixture(sql_mode=True)
-
-
 @pytest.fixture
 def error_email(pub):
     pub.cfg['debug'] = {'error_email': 'errors@localhost.invalid'}
@@ -4732,8 +4723,7 @@ def test_form_ranked_items_randomize_order(pub):
     assert len(orders.keys()) > 1
 
 
-def test_form_autosave(sql_pub):
-    pub = sql_pub
+def test_form_autosave(pub):
     formdef = create_formdef()
     formdef.fields = [
         fields.PageField(id='0', label='1st page', type='page'),
diff --git a/tests/form_pages/test_block.py b/tests/form_pages/test_block.py
index 4ab7c3a32..20ea1eecb 100644
--- a/tests/form_pages/test_block.py
+++ b/tests/form_pages/test_block.py
@@ -25,7 +25,6 @@ def pytest_generate_tests(metafunc):
 @pytest.fixture
 def pub(request, emails):
     pub = create_temporary_pub(
-        sql_mode=bool('sql' in request.param),
         lazy_mode=bool('lazy' in request.param),
     )
     pub.cfg['identification'] = {'methods': ['password']}
diff --git a/tests/form_pages/test_computed_field.py b/tests/form_pages/test_computed_field.py
index 22086e0c3..bbbb8264e 100644
--- a/tests/form_pages/test_computed_field.py
+++ b/tests/form_pages/test_computed_field.py
@@ -16,8 +16,8 @@ from .test_all import create_user
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(sql_mode=True)
+def pub(emails):
+    pub = create_temporary_pub()
     pub.cfg['identification'] = {'methods': ['password']}
     pub.cfg['language'] = {'language': 'en'}
     pub.write_cfg()
diff --git a/tests/form_pages/test_file_field.py b/tests/form_pages/test_file_field.py
index 8f1d59565..f2e65c301 100644
--- a/tests/form_pages/test_file_field.py
+++ b/tests/form_pages/test_file_field.py
@@ -28,7 +28,6 @@ def pytest_generate_tests(metafunc):
 @pytest.fixture
 def pub(request):
     pub = create_temporary_pub(
-        sql_mode=bool('sql' in request.param),
         lazy_mode=bool('lazy' in request.param),
     )
     pub.cfg['identification'] = {'methods': ['password']}
diff --git a/tests/form_pages/test_formdata.py b/tests/form_pages/test_formdata.py
index 80f4441cd..b845258ee 100644
--- a/tests/form_pages/test_formdata.py
+++ b/tests/form_pages/test_formdata.py
@@ -35,7 +35,6 @@ def pytest_generate_tests(metafunc):
 @pytest.fixture
 def pub(request, emails):
     pub = create_temporary_pub(
-        sql_mode=bool('sql' in request.param),
         lazy_mode=bool('lazy' in request.param),
     )
     pub.cfg['identification'] = {'methods': ['password']}
diff --git a/tests/form_pages/test_live.py b/tests/form_pages/test_live.py
index e867894d9..83de71200 100644
--- a/tests/form_pages/test_live.py
+++ b/tests/form_pages/test_live.py
@@ -27,7 +27,6 @@ def pytest_generate_tests(metafunc):
 @pytest.fixture
 def pub(request):
     pub = create_temporary_pub(
-        sql_mode=bool('sql' in request.param),
         lazy_mode=bool('lazy' in request.param),
     )
     pub.cfg['identification'] = {'methods': ['password']}
diff --git a/tests/test_auth_pages.py b/tests/test_auth_pages.py
index 6603826b3..06780774c 100644
--- a/tests/test_auth_pages.py
+++ b/tests/test_auth_pages.py
@@ -9,7 +9,7 @@ from .utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 @pytest.fixture
 def pub():
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
     pub.cfg['identification'] = {'methods': ['password']}
     pub.cfg['language'] = {'language': 'en'}
     pub.write_cfg()
diff --git a/tests/test_carddef.py b/tests/test_carddef.py
index 068b210c0..7cb2222fa 100644
--- a/tests/test_carddef.py
+++ b/tests/test_carddef.py
@@ -17,7 +17,7 @@ from .utilities import clean_temporary_pub, create_temporary_pub
 
 @pytest.fixture
 def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
     pub.cfg['language'] = {'language': 'en'}
diff --git a/tests/test_categories.py b/tests/test_categories.py
index 63b185486..b6f173501 100644
--- a/tests/test_categories.py
+++ b/tests/test_categories.py
@@ -16,7 +16,7 @@ def setup_module(module):
 
     global pub
 
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
 
 
 def teardown_module(module):
diff --git a/tests/test_convert_to_sql.py b/tests/test_convert_to_sql.py
index 6af8493d6..4a29d2a07 100644
--- a/tests/test_convert_to_sql.py
+++ b/tests/test_convert_to_sql.py
@@ -85,7 +85,7 @@ def database(cursor):
 
 @pytest.fixture()
 def pub(request):
-    pub = create_temporary_pub(sql_mode=False)
+    pub = create_temporary_pub(pickle_mode=True)
     yield pub
     clean_temporary_pub()
 
@@ -125,7 +125,7 @@ def test_database_does_not_exist(pub):
 
 
 def test_already_migrated_fails():
-    create_temporary_pub(sql_mode=True)
+    create_temporary_pub()
     with pytest.raises(CommandError) as excinfo:
         call_command('convert_to_sql', '-d', 'example.net', '--database', 'foobar')
     assert str(excinfo.value) == 'tenant already using postgresql'
diff --git a/tests/test_ctl.py b/tests/test_ctl.py
index 6f2af81ce..5ba8a9553 100644
--- a/tests/test_ctl.py
+++ b/tests/test_ctl.py
@@ -28,22 +28,11 @@ from .utilities import clean_temporary_pub, create_temporary_pub
 
 @pytest.fixture
 def pub():
-    yield create_temporary_pub()
-    clean_temporary_pub()
-
-
-@pytest.fixture
-def sql_pub():
-    yield create_temporary_pub(sql_mode=True)
-    clean_temporary_pub()
-
-
-@pytest.fixture
-def two_pubs(request):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
     pub.cfg['language'] = {'language': 'en'}
     pub.write_cfg()
-    return pub
+    yield pub
+    clean_temporary_pub()
 
 
 def teardown_module(module):
@@ -84,11 +73,11 @@ def test_collectstatic(pub, tmp_path):
     assert os.path.islink(required_link) and os.path.exists(required_link)
 
 
-def test_migrate(two_pubs):
+def test_migrate(pub):
     CmdMigrate().handle()
 
 
-def test_migrate_schemas(two_pubs):
+def test_migrate_schemas(pub):
     CmdMigrateSchemas().handle()
 
 
@@ -222,7 +211,7 @@ def test_trigger_jumps(pub):
 
 
 def test_delete_tenant_with_sql(freezer):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
     delete_cmd = CmdDeleteTenant()
 
     assert os.path.isdir(pub.app_dir)
@@ -249,7 +238,7 @@ def test_delete_tenant_with_sql(freezer):
     assert len(cur.fetchall()) == 1
 
     clean_temporary_pub()
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
 
     sub_options = sub_options_class(True)
     delete_cmd.delete_tenant(pub, sub_options, [])
@@ -276,7 +265,7 @@ def test_delete_tenant_with_sql(freezer):
     assert cur.fetchall()
 
     clean_temporary_pub()
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
 
     cleanup_connection()
     sub_options = sub_options_class(True)
@@ -301,7 +290,7 @@ def test_delete_tenant_with_sql(freezer):
     pgconn.close()
 
     clean_temporary_pub()
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
     cleanup_connection()
 
     sub_options = sub_options_class(False)
@@ -375,21 +364,21 @@ def test_delete_tenant_without_sql():
     clean_temporary_pub()
 
 
-def test_rebuild_indexes(two_pubs):
+def test_rebuild_indexes(pub):
     form = FormDef()
     form.name = 'example'
     form.store()
 
-    assert os.listdir(os.path.join(two_pubs.app_dir, 'formdefs-url_name')) == ['example']
+    assert os.listdir(os.path.join(pub.app_dir, 'formdefs-url_name')) == ['example']
 
-    os.unlink(os.path.join(two_pubs.app_dir, 'formdefs-url_name', 'example'))
-    os.symlink('../formdefs/1', os.path.join(two_pubs.app_dir, 'formdefs-url_name', 'XXX'))
-    rebuild_vhost_indexes(two_pubs, destroy=False)
-    assert 'example' in os.listdir(os.path.join(two_pubs.app_dir, 'formdefs-url_name'))
-    assert 'XXX' in os.listdir(os.path.join(two_pubs.app_dir, 'formdefs-url_name'))
+    os.unlink(os.path.join(pub.app_dir, 'formdefs-url_name', 'example'))
+    os.symlink('../formdefs/1', os.path.join(pub.app_dir, 'formdefs-url_name', 'XXX'))
+    rebuild_vhost_indexes(pub, destroy=False)
+    assert 'example' in os.listdir(os.path.join(pub.app_dir, 'formdefs-url_name'))
+    assert 'XXX' in os.listdir(os.path.join(pub.app_dir, 'formdefs-url_name'))
 
-    rebuild_vhost_indexes(two_pubs, destroy=True)
-    assert os.listdir(os.path.join(two_pubs.app_dir, 'formdefs-url_name')) == ['example']
+    rebuild_vhost_indexes(pub, destroy=True)
+    assert os.listdir(os.path.join(pub.app_dir, 'formdefs-url_name')) == ['example']
 
 
 def test_runscript(pub):
@@ -499,7 +488,7 @@ def test_ctl_no_command(capsys):
         sys.argv = old_argv
 
 
-def test_dbshell(sql_pub):
+def test_dbshell(pub):
 
     with pytest.raises(CommandError):
         call_command('dbshell')  # missing tenant name
@@ -508,7 +497,7 @@ def test_dbshell(sql_pub):
         call.side_effect = lambda *args, **kwargs: 0
         call_command('dbshell', '--domain', 'example.net')
         assert call.call_args[0][-1][0] == 'psql'
-        assert call.call_args[0][-1][-1] == sql_pub.cfg['postgresql']['database']
+        assert call.call_args[0][-1][-1] == pub.cfg['postgresql']['database']
 
 
 def test_makemessages(pub):
diff --git a/tests/test_datasource.py b/tests/test_datasource.py
index 22329c4e6..86f5ff5ae 100644
--- a/tests/test_datasource.py
+++ b/tests/test_datasource.py
@@ -23,7 +23,7 @@ from .utilities import clean_temporary_pub, create_temporary_pub
 
 @pytest.fixture
 def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
 
diff --git a/tests/test_datasource_users.py b/tests/test_datasource_users.py
index dab4f9044..65b3fb248 100644
--- a/tests/test_datasource_users.py
+++ b/tests/test_datasource_users.py
@@ -10,7 +10,7 @@ from .utilities import clean_temporary_pub, create_temporary_pub
 
 @pytest.fixture
 def pub():
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
     return pub
diff --git a/tests/test_fc_auth.py b/tests/test_fc_auth.py
index 7de756e4c..19b722666 100644
--- a/tests/test_fc_auth.py
+++ b/tests/test_fc_auth.py
@@ -54,7 +54,7 @@ def base64url_encode(v):
 def setup_module(module):
     cleanup()
     global pub
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
 
 
 def setup_user_profile(pub):
diff --git a/tests/test_formdata.py b/tests/test_formdata.py
index 842f5898e..4cc33c30d 100644
--- a/tests/test_formdata.py
+++ b/tests/test_formdata.py
@@ -41,8 +41,8 @@ from .utilities import clean_temporary_pub, create_temporary_pub
 
 
 @pytest.fixture
-def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+def pub():
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/test_formdef.py b/tests/test_formdef.py
index 48e0014fa..51f0c738e 100644
--- a/tests/test_formdef.py
+++ b/tests/test_formdef.py
@@ -29,8 +29,8 @@ from .utilities import clean_temporary_pub, create_temporary_pub
 
 
 @pytest.fixture
-def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+def pub():
+    pub = create_temporary_pub()
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
     pub.cfg['language'] = {'language': 'en'}
diff --git a/tests/test_logged_errors.py b/tests/test_logged_errors.py
index 45e657fc9..c7008e819 100644
--- a/tests/test_logged_errors.py
+++ b/tests/test_logged_errors.py
@@ -5,7 +5,7 @@ from .utilities import clean_temporary_pub, create_temporary_pub
 
 @pytest.fixture
 def pub(request):
-    return create_temporary_pub(sql_mode=True)
+    return create_temporary_pub()
 
 
 def teardown_module(module):
diff --git a/tests/test_mail_templates.py b/tests/test_mail_templates.py
index 226c1b265..37feb8767 100644
--- a/tests/test_mail_templates.py
+++ b/tests/test_mail_templates.py
@@ -283,7 +283,7 @@ def test_mail_templates_category(pub, superuser):
 
 
 def test_workflow_send_mail_template_with_sql(superuser, emails):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
     pub._set_request(req)
diff --git a/tests/test_publisher.py b/tests/test_publisher.py
index 4c71b6aa2..bfa8cccd2 100644
--- a/tests/test_publisher.py
+++ b/tests/test_publisher.py
@@ -560,14 +560,14 @@ def test_clean_thumbnails():
 
 
 def test_clean_loggederrors_no_sql():
-    pub = create_temporary_pub(sql_mode=False)
+    pub = create_temporary_pub(pickle_mode=True)
 
     # do nothing, no error
     pub.clean_loggederrors()
 
 
 def test_clean_loggederrors():
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
 
     error1 = pub.loggederror_class()
     error1.first_occurence_timestamp = datetime.datetime.now() - datetime.timedelta(seconds=1)
diff --git a/tests/test_register.py b/tests/test_register.py
index eb50992ce..7fa97284e 100644
--- a/tests/test_register.py
+++ b/tests/test_register.py
@@ -12,7 +12,7 @@ from .utilities import clean_temporary_pub, create_temporary_pub, get_app
 
 @pytest.fixture
 def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
 
     req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
     pub.set_app_dir(req)
diff --git a/tests/test_rootdirectory.py b/tests/test_rootdirectory.py
index 76ba7845f..0b3f098e8 100644
--- a/tests/test_rootdirectory.py
+++ b/tests/test_rootdirectory.py
@@ -29,7 +29,7 @@ def pub():
 
 @pytest.fixture
 def pickle_pub():
-    yield create_temporary_pub(sql_mode=False)
+    yield create_temporary_pub(pickle_mode=True)
     clean_temporary_pub()
 
 
diff --git a/tests/test_saml_auth.py b/tests/test_saml_auth.py
index d111d558d..88009aeb1 100644
--- a/tests/test_saml_auth.py
+++ b/tests/test_saml_auth.py
@@ -44,8 +44,8 @@ role_uuid2 = str(uuid.uuid4())
 
 
 @pytest.fixture
-def pub(request):
-    pub = create_temporary_pub(sql_mode=True)
+def pub():
+    pub = create_temporary_pub()
 
     if not pub.cfg:
         pub.cfg = {}
diff --git a/tests/test_snapshots.py b/tests/test_snapshots.py
index 3c104efa1..3dcde6c7e 100644
--- a/tests/test_snapshots.py
+++ b/tests/test_snapshots.py
@@ -24,11 +24,8 @@ from .utilities import clean_temporary_pub, create_temporary_pub, get_app, login
 
 
 @pytest.fixture
-def pub(request, emails):
-    pub = create_temporary_pub(
-        sql_mode=True,
-        lazy_mode=True,
-    )
+def pub(emails):
+    pub = create_temporary_pub(lazy_mode=True)
     pub.cfg['identification'] = {'methods': ['password']}
     pub.cfg['language'] = {'language': 'en'}
     pub.write_cfg()
diff --git a/tests/test_sql.py b/tests/test_sql.py
index 92d7fff40..77182f205 100644
--- a/tests/test_sql.py
+++ b/tests/test_sql.py
@@ -22,7 +22,7 @@ from .utilities import clean_temporary_pub, create_temporary_pub
 
 @pytest.fixture
 def pub(request):
-    return create_temporary_pub(sql_mode=True)
+    return create_temporary_pub()
 
 
 @pytest.fixture
diff --git a/tests/test_token.py b/tests/test_token.py
index 8a7bccc2b..237b297a7 100644
--- a/tests/test_token.py
+++ b/tests/test_token.py
@@ -13,7 +13,7 @@ from .utilities import create_temporary_pub
 
 @pytest.fixture
 def pub(request):
-    return create_temporary_pub(sql_mode=True)
+    return create_temporary_pub()
 
 
 def test_migrate_to_sql(pub):
diff --git a/tests/test_tracking_code.py b/tests/test_tracking_code.py
index 3bf7eff33..392896ac7 100644
--- a/tests/test_tracking_code.py
+++ b/tests/test_tracking_code.py
@@ -7,7 +7,7 @@ from .utilities import clean_temporary_pub, create_temporary_pub
 
 @pytest.fixture
 def pub(request):
-    return create_temporary_pub(sql_mode=True)
+    return create_temporary_pub()
 
 
 def teardown_module(module):
diff --git a/tests/test_upload_storage.py b/tests/test_upload_storage.py
index c9f1bd46c..9df29c6e7 100644
--- a/tests/test_upload_storage.py
+++ b/tests/test_upload_storage.py
@@ -23,7 +23,6 @@ def pytest_generate_tests(metafunc):
 @pytest.fixture
 def pub(request, emails):
     pub = create_temporary_pub(
-        sql_mode=bool('sql' in request.param),
         lazy_mode=bool('lazy' in request.param),
     )
     pub.cfg['identification'] = {'methods': ['password']}
diff --git a/tests/test_wscall.py b/tests/test_wscall.py
index fc7873437..367b0abc9 100644
--- a/tests/test_wscall.py
+++ b/tests/test_wscall.py
@@ -180,7 +180,7 @@ def test_webservice_delete(http_requests, pub):
 @pytest.mark.parametrize('notify_on_errors', [True, False])
 @pytest.mark.parametrize('record_on_errors', [True, False])
 def test_webservice_on_error_with_sql(http_requests, emails, notify_on_errors, record_on_errors):
-    pub = create_temporary_pub(sql_mode=True)
+    pub = create_temporary_pub()
     pub.cfg['debug'] = {'error_email': 'errors@localhost.invalid'}
     pub.write_cfg()
 
diff --git a/tests/utilities.py b/tests/utilities.py
index ac1f913bd..17800b24e 100644
--- a/tests/utilities.py
+++ b/tests/utilities.py
@@ -43,7 +43,7 @@ class KnownElements:
 known_elements = KnownElements()
 
 
-def create_temporary_pub(sql_mode=True, legacy_theme_mode=False, lazy_mode=False):
+def create_temporary_pub(pickle_mode=False, legacy_theme_mode=False, lazy_mode=False):
     if get_publisher():
         get_publisher().cleanup()
         cleanup()
@@ -51,20 +51,20 @@ def create_temporary_pub(sql_mode=True, legacy_theme_mode=False, lazy_mode=False
         APP_DIR = known_elements.legacy_theme_app_dir
     elif lazy_mode and known_elements.lazy_app_dir:
         APP_DIR = known_elements.lazy_app_dir
-    elif sql_mode and known_elements.sql_app_dir and not lazy_mode:
-        APP_DIR = known_elements.sql_app_dir
-    elif not (legacy_theme_mode or lazy_mode or sql_mode) and known_elements.pickle_app_dir:
+    elif pickle_mode and known_elements.pickle_app_dir:
         APP_DIR = known_elements.pickle_app_dir
+    elif not (legacy_theme_mode or lazy_mode or pickle_mode) and known_elements.sql_app_dir:
+        APP_DIR = known_elements.sql_app_dir
     else:
         APP_DIR = tempfile.mkdtemp()
         if legacy_theme_mode:
             known_elements.legacy_theme_app_dir = APP_DIR
         elif lazy_mode:
             known_elements.lazy_app_dir = APP_DIR
-        elif sql_mode and not lazy_mode:
-            known_elements.sql_app_dir = APP_DIR
-        else:
+        elif pickle_mode:
             known_elements.pickle_app_dir = APP_DIR
+        else:
+            known_elements.sql_app_dir = APP_DIR
 
     compat.CompatWcsPublisher.APP_DIR = APP_DIR
     compat.CompatWcsPublisher.DATA_DIR = os.path.abspath(
@@ -76,7 +76,7 @@ def create_temporary_pub(sql_mode=True, legacy_theme_mode=False, lazy_mode=False
     pub.app_dir = os.path.join(APP_DIR, 'example.net')
     pub.site_charset = 'utf-8'
 
-    if sql_mode:
+    if not pickle_mode:
         pub.user_class = sql.SqlUser
         pub.role_class = sql.Role
         pub.token_class = sql.Token
@@ -117,8 +117,6 @@ def create_temporary_pub(sql_mode=True, legacy_theme_mode=False, lazy_mode=False
         fd.write('workflow-resubmit-action = true\n')
         if lazy_mode:
             fd.write('force-lazy-mode = true\n')
-        if sql_mode:
-            fd.write('postgresql = true\n')
 
     # make sure site options are not cached
     pub.site_options = None
@@ -138,7 +136,7 @@ def create_temporary_pub(sql_mode=True, legacy_theme_mode=False, lazy_mode=False
     pub.write_cfg()
 
     if not created:
-        if sql_mode:
+        if not pickle_mode:
             pub.cfg['postgresql'] = {'database': known_elements.sql_db_name, 'user': os.environ['USER']}
             pub.loggederror_class.wipe()
         pub.write_cfg()
@@ -146,7 +144,7 @@ def create_temporary_pub(sql_mode=True, legacy_theme_mode=False, lazy_mode=False
 
     os.symlink(os.path.join(os.path.dirname(__file__), 'templates'), os.path.join(pub.app_dir, 'templates'))
 
-    if sql_mode:
+    if not pickle_mode:
         conn = psycopg2.connect(user=os.environ['USER'], dbname='postgres')
         conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
         i = 0
diff --git a/tests/workflow/test_all.py b/tests/workflow/test_all.py
index c1e3bdfaa..c60503ed5 100644
--- a/tests/workflow/test_all.py
+++ b/tests/workflow/test_all.py
@@ -92,8 +92,9 @@ def teardown_module(module):
     clean_temporary_pub()
 
 
-def pub_fixture(**kwargs):
-    pub = create_temporary_pub(**kwargs)
+@pytest.fixture
+def pub():
+    pub = create_temporary_pub()
     pub.cfg['language'] = {'language': 'en'}
     pub.cfg['identification'] = {'methods': ['password']}
     pub.write_cfg()
@@ -106,21 +107,6 @@ def pub_fixture(**kwargs):
     return pub
 
 
-@pytest.fixture
-def pub(request):
-    return pub_fixture()
-
-
-@pytest.fixture
-def two_pubs(request):
-    return pub_fixture(sql_mode=True)
-
-
-@pytest.fixture
-def sql_pub(request):
-    return pub_fixture(sql_mode=True)
-
-
 @pytest.fixture
 def admin_user():
     get_publisher().user_class.wipe()
@@ -372,31 +358,31 @@ def test_jump_count_condition(pub):
     assert item.check_condition(formdata) is False
 
 
-def test_jump_bad_python_condition(two_pubs):
+def test_jump_bad_python_condition(pub):
     FormDef.wipe()
     formdef = FormDef()
     formdef.name = 'foobar'
     formdef.store()
-    two_pubs.substitutions.feed(formdef)
+    pub.substitutions.feed(formdef)
     formdef.data_class().wipe()
     formdata = formdef.data_class()()
     item = JumpWorkflowStatusItem()
 
     item.condition = {'type': 'python', 'value': 'form_var_foobar == 0'}
     assert item.check_condition(formdata) is False
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary == 'Failed to evaluate condition'
     assert logged_error.exception_class == 'NameError'
     assert logged_error.exception_message == "name 'form_var_foobar' is not defined"
     assert logged_error.expression == 'form_var_foobar == 0'
     assert logged_error.expression_type == 'python'
 
-    two_pubs.loggederror_class.wipe()
+    pub.loggederror_class.wipe()
     item.condition = {'type': 'python', 'value': '~ invalid ~'}
     assert item.check_condition(formdata) is False
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary == 'Failed to evaluate condition'
     assert logged_error.exception_class == 'SyntaxError'
     assert logged_error.exception_message == 'unexpected EOF while parsing (<string>, line 1)'
@@ -404,7 +390,7 @@ def test_jump_bad_python_condition(two_pubs):
     assert logged_error.expression_type == 'python'
 
 
-def test_jump_django_conditions(two_pubs):
+def test_jump_django_conditions(pub):
     FormDef.wipe()
     formdef = FormDef()
     formdef.name = 'foobar'
@@ -414,7 +400,7 @@ def test_jump_django_conditions(two_pubs):
     formdef.store()
     formdata = formdef.data_class()()
     formdata.data = {'1': 'hello'}
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item = JumpWorkflowStatusItem()
 
     item.condition = {'type': 'django', 'value': '1 < 2'}
@@ -429,12 +415,12 @@ def test_jump_django_conditions(two_pubs):
     item.condition = {'type': 'django', 'value': 'form_var_foo|first|upper == "X"'}
     assert item.check_condition(formdata) is False
 
-    assert two_pubs.loggederror_class.count() == 0
+    assert pub.loggederror_class.count() == 0
 
     item.condition = {'type': 'django', 'value': '~ invalid ~'}
     assert item.check_condition(formdata) is False
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary == 'Failed to evaluate condition'
     assert logged_error.exception_class == 'TemplateSyntaxError'
     assert logged_error.exception_message == "Could not parse the remainder: '~' from '~'"
@@ -573,7 +559,7 @@ def test_dispatch_multi(pub):
     assert formdata.workflow_roles == {'_receiver': [role.id]}
 
 
-def test_dispatch_auto(two_pubs):
+def test_dispatch_auto(pub):
     formdef = FormDef()
     formdef.name = 'baz'
     formdef.fields = [
@@ -586,15 +572,15 @@ def test_dispatch_auto(two_pubs):
     item.dispatch_type = 'automatic'
 
     formdata = formdef.data_class()()
-    two_pubs.substitutions.reset()
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.reset()
+    pub.substitutions.feed(formdata)
     item.perform(formdata)
     assert not formdata.workflow_roles
 
-    two_pubs.role_class.wipe()
-    role1 = two_pubs.role_class('xxx1')
+    pub.role_class.wipe()
+    role1 = pub.role_class('xxx1')
     role1.store()
-    role2 = two_pubs.role_class('xxx2')
+    role2 = pub.role_class('xxx2')
     role2.store()
 
     for variable in ('form_var_foo', '{{form_var_foo}}'):
@@ -607,36 +593,36 @@ def test_dispatch_auto(two_pubs):
             {'role_id': role1.id, 'value': '42'},
         ]
 
-        two_pubs.substitutions.reset()
-        two_pubs.substitutions.feed(formdata)
+        pub.substitutions.reset()
+        pub.substitutions.feed(formdata)
         item.perform(formdata)
         assert not formdata.workflow_roles
 
         # no match
         formdata.data = {'1': 'XXX'}
-        two_pubs.substitutions.reset()
-        two_pubs.substitutions.feed(formdata)
+        pub.substitutions.reset()
+        pub.substitutions.feed(formdata)
         item.perform(formdata)
         assert not formdata.workflow_roles
 
         # match
         formdata.data = {'1': 'foo'}
-        two_pubs.substitutions.reset()
-        two_pubs.substitutions.feed(formdata)
+        pub.substitutions.reset()
+        pub.substitutions.feed(formdata)
         item.perform(formdata)
         assert formdata.workflow_roles == {'_receiver': [role1.id]}
 
         # other match
         formdata.data = {'1': 'bar'}
-        two_pubs.substitutions.reset()
-        two_pubs.substitutions.feed(formdata)
+        pub.substitutions.reset()
+        pub.substitutions.feed(formdata)
         item.perform(formdata)
         assert formdata.workflow_roles == {'_receiver': [role2.id]}
 
         # integer match
-        two_pubs.substitutions.reset()
+        pub.substitutions.reset()
         # cannot store an integer in formdata.data, we mock substitutions:
-        two_pubs.substitutions.feed({'form_var_foo': 42})
+        pub.substitutions.feed({'form_var_foo': 42})
         item.perform(formdata)
         assert formdata.workflow_roles == {'_receiver': [role1.id]}
 
@@ -647,12 +633,12 @@ def test_dispatch_auto(two_pubs):
     item.rules = [
         {'role_id': 'foobar', 'value': 'foo'},
     ]
-    two_pubs.substitutions.reset()
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.reset()
+    pub.substitutions.feed(formdata)
     item.perform(formdata)
     assert not formdata.workflow_roles
-    assert two_pubs.loggederror_class.count() == 1
-    error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    error = pub.loggederror_class.select()[0]
     assert error.tech_id == '%s-_default-error-in-dispatch-missing-role-foobar' % formdef.id
     assert error.formdef_id == formdef.id
     assert error.workflow_id == '_default'
@@ -660,13 +646,13 @@ def test_dispatch_auto(two_pubs):
     assert error.occurences_count == 1
 
 
-def test_dispatch_computed(two_pubs):
+def test_dispatch_computed(pub):
     formdef = FormDef()
     formdef.name = 'baz'
     formdef.store()
 
-    two_pubs.role_class.wipe()
-    role = two_pubs.role_class(name='xxx')
+    pub.role_class.wipe()
+    role = pub.role_class(name='xxx')
     role.slug = 'yyy'
     role.store()
 
@@ -707,8 +693,8 @@ def test_dispatch_computed(two_pubs):
     item.role_id = '="foobar"'
     item.perform(formdata)
     assert not formdata.workflow_roles
-    assert two_pubs.loggederror_class.count() == 1
-    error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    error = pub.loggederror_class.select()[0]
     assert error.tech_id == '%s-_default-error-in-dispatch-missing-role-foobar' % formdef.id
     assert error.formdef_id == formdef.id
     assert error.workflow_id == '_default'
@@ -716,14 +702,14 @@ def test_dispatch_computed(two_pubs):
     assert error.occurences_count == 1
 
     # unknown role, with template
-    two_pubs.loggederror_class.wipe()
+    pub.loggederror_class.wipe()
     formdata = formdef.data_class()()
     item.role_key = '_receiver'
     item.role_id = '{{ "foobar" }}'
     item.perform(formdata)
     assert not formdata.workflow_roles
-    assert two_pubs.loggederror_class.count() == 1
-    error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    error = pub.loggederror_class.select()[0]
     assert (
         error.tech_id == '%s-_default-error-in-dispatch-missing-role-foobar-from-foobar-template' % formdef.id
     )
@@ -780,8 +766,7 @@ def test_dispatch_user(pub):
     assert formdata.workflow_roles == {}
 
 
-def test_roles(two_pubs):
-    pub = two_pubs
+def test_roles(pub):
     pub.role_class.wipe()
     role = pub.role_class(name='xxx')
     role.store()
@@ -974,7 +959,7 @@ def test_roles_idp(pub):
         assert pub.user_class.get(user.id).roles == []
 
 
-def test_anonymise(two_pubs):
+def test_anonymise(pub):
     # build a backoffice field
     Workflow.wipe()
     wf = Workflow(name='wf with backoffice field')
@@ -1028,7 +1013,7 @@ def test_anonymise(two_pubs):
     assert formdef.data_class().get(formdata.id).evolution[0].who is None
 
 
-def test_remove(two_pubs):
+def test_remove(pub):
     formdef = FormDef()
     formdef.name = 'baz'
     formdef.store()
@@ -1048,7 +1033,7 @@ def test_remove(two_pubs):
     formdata.store()
 
     item = RemoveWorkflowStatusItem()
-    req = two_pubs.get_request()
+    req = pub.get_request()
     req.response.filter['in_backoffice'] = True
     assert formdef.data_class().count() == 1
     with pytest.raises(AbortActionException) as e:
@@ -1059,7 +1044,7 @@ def test_remove(two_pubs):
     assert req.session.message
 
 
-def test_stop_on_remove(two_pubs, emails):
+def test_stop_on_remove(pub, emails):
     workflow = Workflow(name='stop-on-remove')
     st1 = workflow.add_status('Status1', 'st1')
 
@@ -1077,7 +1062,7 @@ def test_stop_on_remove(two_pubs, emails):
     workflow.store()
 
     formdef = FormDef()
-    formdef.name = 'baz%s' % id(two_pubs)
+    formdef.name = 'baz%s' % id(pub)
     formdef.fields = []
     formdef.workflow_id = workflow.id
     assert formdef.get_workflow().id == workflow.id
@@ -1227,8 +1212,8 @@ def test_register_comment_django_escaping(pub, emails):
     assert formdata.evolution[-1].display_parts()[-1] == '<div><p>hello</p></div>'
 
 
-def test_register_comment_attachment(two_pubs):
-    two_pubs.substitutions.feed(MockSubstitutionVariables())
+def test_register_comment_attachment(pub):
+    pub.substitutions.feed(MockSubstitutionVariables())
 
     formdef = FormDef()
     formdef.name = 'baz'
@@ -1258,20 +1243,20 @@ def test_register_comment_attachment(two_pubs):
 
     item.comment = '{{ attachments.testfile.url }}'
 
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item.perform(formdata)
     url1 = formdata.evolution[-1].parts[-1].content
-    assert two_pubs.loggederror_class.count() == 1
-    error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    error = pub.loggederror_class.select()[0]
     assert error.kind == 'deprecated_usage'
     assert error.occurences_count == 1
 
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item.comment = '{{ form_attachments.testfile.url }}'
     item.perform(formdata)
     url2 = formdata.evolution[-1].parts[-1].content
-    assert two_pubs.loggederror_class.count() == 1
-    error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    error = pub.loggederror_class.select()[0]
     assert error.kind == 'deprecated_usage'
     assert error.occurences_count == 1
 
@@ -1296,21 +1281,21 @@ def test_register_comment_attachment(two_pubs):
     item.condition = {'type': 'django', 'value': 'form_attachments.missing'}
     assert item.check_condition(formdata) is False
 
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item.comment = '[attachments.testfile.url]'
     item.perform(formdata)
     url3 = formdata.evolution[-1].parts[-1].content
-    assert two_pubs.loggederror_class.count() == 1
-    error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    error = pub.loggederror_class.select()[0]
     assert error.kind == 'deprecated_usage'
     assert error.occurences_count == 2
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item.comment = '[form_attachments.testfile.url]'
     item.perform(formdata)
     url4 = formdata.evolution[-1].parts[-1].content
     assert url3 == url4
-    assert two_pubs.loggederror_class.count() == 1
-    error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    error = pub.loggederror_class.select()[0]
     assert error.kind == 'deprecated_usage'
     assert error.occurences_count == 2
 
@@ -1596,8 +1581,7 @@ def test_register_comment_to_with_attachment(pub):
     assert 'to-role-or-submitter.txt' in display_parts()[6]
 
 
-def test_webservice_call(http_requests, two_pubs):
-    pub = two_pubs
+def test_webservice_call(http_requests, pub):
     pub.substitutions.feed(MockSubstitutionVariables())
 
     wf = Workflow(name='wf1')
@@ -2402,7 +2386,7 @@ def rewind(formdata, seconds):
     formdata.evolution[-1].time = rewind_time(formdata.evolution[-1].time)
 
 
-def test_timeout(two_pubs):
+def test_timeout(pub):
     workflow = Workflow(name='timeout')
     st1 = workflow.add_status('Status1', 'st1')
     workflow.add_status('Status2', 'st2')
@@ -2427,7 +2411,7 @@ def test_timeout(two_pubs):
     formdata.store()
     formdata_id = formdata.id
 
-    _apply_timeouts(two_pubs)
+    _apply_timeouts(pub)
 
     assert formdef.data_class().get(formdata_id).status == 'wf-st2'
 
@@ -2437,7 +2421,7 @@ def test_timeout(two_pubs):
     formdata_id = formdata.id
     with mock.patch('wcs.wf.jump.JumpWorkflowStatusItem.check_condition') as must_jump:
         must_jump.return_value = False
-        _apply_timeouts(two_pubs)
+        _apply_timeouts(pub)
         assert must_jump.call_count == 0  # not enough time has passed
 
         # check a lower than minimal delay is not considered
@@ -2445,29 +2429,29 @@ def test_timeout(two_pubs):
         workflow.store()
         rewind(formdata, seconds=10 * 60)
         formdata.store()
-        _apply_timeouts(two_pubs)
+        _apply_timeouts(pub)
         assert must_jump.call_count == 0
 
         # but is executed once delay is reached
         rewind(formdata, seconds=10 * 60)
         formdata.store()
-        _apply_timeouts(two_pubs)
+        _apply_timeouts(pub)
         assert must_jump.call_count == 1
 
         # check a templated timeout is considered as minimal delay for explicit evaluation
         jump.timeout = '{{ "0" }}'
         workflow.store()
-        _apply_timeouts(two_pubs)
+        _apply_timeouts(pub)
         assert must_jump.call_count == 2
 
     # check there's no crash on workflow without jumps
     formdef = FormDef()
     formdef.name = 'xxx'
     formdef.store()
-    _apply_timeouts(two_pubs)
+    _apply_timeouts(pub)
 
 
-def test_timeout_with_humantime_template(two_pubs):
+def test_timeout_with_humantime_template(pub):
     workflow = Workflow(name='timeout')
     st1 = workflow.add_status('Status1', 'st1')
     workflow.add_status('Status2', 'st2')
@@ -2491,12 +2475,12 @@ def test_timeout_with_humantime_template(two_pubs):
     formdata.store()
     formdata_id = formdata.id
 
-    _apply_timeouts(two_pubs)
+    _apply_timeouts(pub)
     assert formdef.data_class().get(formdata_id).status == 'wf-st1'  # no change
 
     rewind(formdata, seconds=40 * 60)
     formdata.store()
-    _apply_timeouts(two_pubs)
+    _apply_timeouts(pub)
     assert formdef.data_class().get(formdata_id).status == 'wf-st2'
 
     # invalid timeout value
@@ -2509,15 +2493,15 @@ def test_timeout_with_humantime_template(two_pubs):
     formdata.store()
     formdata_id = formdata.id
 
-    two_pubs.loggederror_class.wipe()
+    pub.loggederror_class.wipe()
 
     rewind(formdata, seconds=40 * 60)
     formdata.store()
-    _apply_timeouts(two_pubs)
+    _apply_timeouts(pub)
     assert formdef.data_class().get(formdata_id).status == 'wf-st1'  # no change
 
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary == "Error in timeout value '30 plop' (computed from '{{ 30 }} plop')"
 
     # template timeout value returning nothing
@@ -2530,15 +2514,15 @@ def test_timeout_with_humantime_template(two_pubs):
     formdata.store()
     formdata_id = formdata.id
 
-    two_pubs.loggederror_class.wipe()
+    pub.loggederror_class.wipe()
 
     rewind(formdata, seconds=40 * 60)
     formdata.store()
-    _apply_timeouts(two_pubs)
+    _apply_timeouts(pub)
     assert formdef.data_class().get(formdata_id).status == 'wf-st1'  # no change
 
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary == "Error in timeout value '' (computed from '{% if 1 %}{% endif %}')"
 
 
@@ -2571,7 +2555,7 @@ def test_legacy_timeout(pub):
     assert formdef.data_class().get(formdata_id).status == 'wf-st2'
 
 
-def test_timeout_then_remove(two_pubs):
+def test_timeout_then_remove(pub):
     workflow = Workflow(name='timeout-then-remove')
     st1 = workflow.add_status('Status1', 'st1')
     st2 = workflow.add_status('Status2', 'st2')
@@ -2586,7 +2570,7 @@ def test_timeout_then_remove(two_pubs):
     workflow.store()
 
     formdef = FormDef()
-    formdef.name = 'baz%s' % id(two_pubs)
+    formdef.name = 'baz%s' % id(pub)
     formdef.fields = []
     formdef.workflow_id = workflow.id
     assert formdef.get_workflow().id == workflow.id
@@ -2600,12 +2584,12 @@ def test_timeout_then_remove(two_pubs):
 
     assert str(formdata_id) in [str(x) for x in formdef.data_class().keys()]
 
-    _apply_timeouts(two_pubs)
+    _apply_timeouts(pub)
 
     assert not str(formdata_id) in [str(x) for x in formdef.data_class().keys()]
 
 
-def test_timeout_with_mark(two_pubs):
+def test_timeout_with_mark(pub):
     workflow = Workflow(name='timeout')
     st1 = workflow.add_status('Status1', 'st1')
     workflow.add_status('Status2', 'st2')
@@ -2631,13 +2615,13 @@ def test_timeout_with_mark(two_pubs):
     formdata.store()
     formdata_id = formdata.id
 
-    _apply_timeouts(two_pubs)
+    _apply_timeouts(pub)
 
     formdata = formdef.data_class().get(formdata_id)
     assert formdata.workflow_data.get('_markers_stack') == [{'status_id': 'st1'}]
 
 
-def test_jump_missing_previous_mark(two_pubs):
+def test_jump_missing_previous_mark(pub):
     FormDef.wipe()
     Workflow.wipe()
 
@@ -2662,9 +2646,9 @@ def test_jump_missing_previous_mark(two_pubs):
     rewind(formdata, seconds=40 * 60)
     formdata.store()
 
-    two_pubs.loggederror_class.wipe()
-    _apply_timeouts(two_pubs)
-    assert two_pubs.loggederror_class.count() == 1
+    pub.loggederror_class.wipe()
+    _apply_timeouts(pub)
+    assert pub.loggederror_class.count() == 1
 
 
 def test_sms(pub, sms_mocking):
@@ -2778,8 +2762,7 @@ def test_sms_many_recipients(pub, sms_mocking):
         assert sms_mocking.sms[0]['text'] == 'XXX'
 
 
-def test_sms_with_passerelle(two_pubs):
-    pub = two_pubs
+def test_sms_with_passerelle(pub):
     pub.cfg['sms'] = {
         'mode': 'passerelle',
         'passerelle_url': 'http://passerelle.example.com/send?nostop=1',
@@ -2828,7 +2811,7 @@ def test_sms_with_passerelle(two_pubs):
             assert pub.loggederror_class.select()[0].summary == 'Could not send SMS'
 
 
-def test_display_form(two_pubs):
+def test_display_form(pub):
     formdef = FormDef()
     formdef.name = 'baz'
     formdef.fields = []
@@ -2852,21 +2835,21 @@ def test_display_form(two_pubs):
     assert form.widgets[0].title == 'Test'
     assert form.widgets[1].title == 'Date'
 
-    two_pubs.get_request().environ['REQUEST_METHOD'] = 'POST'
-    two_pubs.get_request().form = {'fxxx_1': 'Foobar', 'fxxx_2': '2015-05-12', 'submit': 'submit'}
+    pub.get_request().environ['REQUEST_METHOD'] = 'POST'
+    pub.get_request().form = {'fxxx_1': 'Foobar', 'fxxx_2': '2015-05-12', 'submit': 'submit'}
     display_form.submit_form(form, formdata, None, None)
 
     assert formdata.get_substitution_variables()['xxx_var_date'] == '2015-05-12'
 
-    two_pubs.cfg['language'] = {'language': 'fr'}
+    pub.cfg['language'] = {'language': 'fr'}
     formdata = formdef.data_class()()
     formdata.just_created()
     formdata.store()
 
     form = Form(action='#', use_tokens=False)
     display_form.fill_form(form, formdata, None)
-    two_pubs.get_request().environ['REQUEST_METHOD'] = 'POST'
-    two_pubs.get_request().form = {'fxxx_1': 'Foobar', 'fxxx_2': '12/05/2015', 'submit': 'submit'}
+    pub.get_request().environ['REQUEST_METHOD'] = 'POST'
+    pub.get_request().form = {'fxxx_1': 'Foobar', 'fxxx_2': '12/05/2015', 'submit': 'submit'}
     display_form.submit_form(form, formdata, None, None)
     assert formdata.get_substitution_variables()['xxx_var_date'] == '12/05/2015'
 
@@ -2874,7 +2857,7 @@ def test_display_form(two_pubs):
         '2015-05-12', '%Y-%m-%d'
     )
 
-    two_pubs.cfg['language'] = {'language': 'en'}
+    pub.cfg['language'] = {'language': 'en'}
 
 
 def test_display_form_and_comment(pub):
@@ -3292,7 +3275,7 @@ def test_criticality(pub):
     assert formdata.get_criticality_level_object().name == 'green'
 
 
-def test_geolocate_action_enable_geolocation(two_pubs):
+def test_geolocate_action_enable_geolocation(pub):
     # switch to a workflow with geolocation
     formdef = FormDef()
     formdef.name = 'foo'
@@ -3342,7 +3325,7 @@ def test_geolocate_action_enable_geolocation(two_pubs):
     cur.close()
 
 
-def test_geolocate_address(two_pubs):
+def test_geolocate_address(pub):
     formdef = FormDef()
     formdef.geolocations = {'base': 'bla'}
     formdef.name = 'baz'
@@ -3355,7 +3338,7 @@ def test_geolocate_address(two_pubs):
     formdata.data = {'1': '169 rue du chateau'}
     formdata.just_created()
     formdata.store()
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
 
     item = GeolocateWorkflowStatusItem()
     item.method = 'address_string'
@@ -3374,8 +3357,8 @@ def test_geolocate_address(two_pubs):
         assert int(formdata.geolocations['base']['lat']) == 48
         assert int(formdata.geolocations['base']['lon']) == 2
 
-    two_pubs.load_site_options()
-    two_pubs.site_options.set('options', 'nominatim_key', 'KEY')
+    pub.load_site_options()
+    pub.site_options.set('options', 'nominatim_key', 'KEY')
     with mock.patch('wcs.wf.geolocate.http_get_page') as http_get_page:
         http_get_page.return_value = (
             None,
@@ -3390,8 +3373,8 @@ def test_geolocate_address(two_pubs):
         assert int(formdata.geolocations['base']['lat']) == 48
         assert int(formdata.geolocations['base']['lon']) == 2
 
-    two_pubs.load_site_options()
-    two_pubs.site_options.set('options', 'geocoding_service_url', 'http://example.net/')
+    pub.load_site_options()
+    pub.site_options.set('options', 'geocoding_service_url', 'http://example.net/')
     with mock.patch('wcs.wf.geolocate.http_get_page') as http_get_page:
         http_get_page.return_value = (
             None,
@@ -3402,7 +3385,7 @@ def test_geolocate_address(two_pubs):
         item.perform(formdata)
         assert 'http://example.net/?q=' in http_get_page.call_args[0][0]
 
-    two_pubs.site_options.set('options', 'geocoding_service_url', 'http://example.net/?param=value')
+    pub.site_options.set('options', 'geocoding_service_url', 'http://example.net/?param=value')
     with mock.patch('wcs.wf.geolocate.http_get_page') as http_get_page:
         http_get_page.return_value = (
             None,
@@ -3418,8 +3401,8 @@ def test_geolocate_address(two_pubs):
     formdata.geolocations = None
     item.perform(formdata)
     assert formdata.geolocations == {}
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert (
         logged_error.summary
         == 'error in template for address string [syntax error in ezt template: unclosed block at line 1 and column 24]'
@@ -3430,7 +3413,7 @@ def test_geolocate_address(two_pubs):
         logged_error.exception_message
         == 'syntax error in ezt template: unclosed block at line 1 and column 24'
     )
-    two_pubs.loggederror_class.wipe()
+    pub.loggederror_class.wipe()
 
     # check for None
     item.address_string = '=None'
@@ -3459,8 +3442,8 @@ def test_geolocate_address(two_pubs):
         http_get_page.side_effect = ConnectionError('some error')
         item.perform(formdata)
         assert formdata.geolocations == {}
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary == 'error calling geocoding service [some error]'
     assert logged_error.formdata_id == str(formdata.id)
     assert logged_error.exception_class == 'ConnectionError'
@@ -3516,7 +3499,7 @@ def test_geolocate_image(pub):
     assert formdata.geolocations == {}
 
 
-def test_geolocate_map(two_pubs):
+def test_geolocate_map(pub):
     formdef = FormDef()
     formdef.name = 'baz'
     formdef.geolocations = {'base': 'bla'}
@@ -3529,7 +3512,7 @@ def test_geolocate_map(two_pubs):
     formdata.data = {'2': '48.8337085;2.3233693'}
     formdata.just_created()
     formdata.store()
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
 
     item = GeolocateWorkflowStatusItem()
     item.method = 'map_variable'
@@ -3549,8 +3532,8 @@ def test_geolocate_map(two_pubs):
     formdata.geolocations = None
     formdata.data = {'2': '48.8337085'}
     item.map_variable = '=form_var_map'
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary == 'error geolocating from map variable'
     assert logged_error.formdata_id == str(formdata.id)
     assert logged_error.exception_class == 'ValueError'
@@ -3828,8 +3811,7 @@ def test_export_to_model_django_template(pub):
     assert b'>A &lt;&gt; name<' in new_content
 
 
-def test_export_to_model_xml(two_pubs):
-    pub = two_pubs
+def test_export_to_model_xml(pub):
     LoggedError = pub.loggederror_class
     if LoggedError:
         LoggedError.wipe()
@@ -3991,8 +3973,7 @@ def test_export_to_model_form_details_section(pub, filename):
 
 
 @pytest.mark.parametrize('formdef_class', [FormDef, CardDef])
-def test_global_timeouts(two_pubs, formdef_class):
-    pub = two_pubs
+def test_global_timeouts(pub, formdef_class):
     CardDef.wipe()
     FormDef.wipe()
     Workflow.wipe()
@@ -4263,8 +4244,7 @@ def test_global_timeouts(two_pubs, formdef_class):
     formdata1.store()
 
 
-def test_global_timeouts_latest_arrival(two_pubs):
-    pub = two_pubs
+def test_global_timeouts_latest_arrival(pub):
     FormDef.wipe()
     Workflow.wipe()
 
@@ -4338,8 +4318,8 @@ def test_global_timeouts_latest_arrival(two_pubs):
     assert formdef.data_class().get(formdata1.id).get_criticality_level_object().name == 'green'
 
 
-def test_profile(two_pubs):
-    User = two_pubs.user_class
+def test_profile(pub):
+    User = pub.user_class
     user = User()
     user.store()
 
@@ -4373,7 +4353,7 @@ def test_profile(two_pubs):
 
     from wcs.admin.settings import UserFieldsFormDef
 
-    formdef = UserFieldsFormDef(two_pubs)
+    formdef = UserFieldsFormDef(pub)
     formdef.fields = [
         StringField(id='3', label='test', type='string', varname='plop'),
         DateField(id='4', label='Date', type='date', varname='bar'),
@@ -4435,7 +4415,7 @@ def test_profile(two_pubs):
                 assert http_patch_request.call_args[0][1] == '{"bar": null}'
 
     # out of http request/response cycle (cron, after_job)
-    two_pubs._set_request(None)
+    pub._set_request(None)
     item.fields = [{'field_id': 'bar', 'value': '01/01/2020'}]
     with mock.patch('wcs.wf.profile.http_patch_request') as http_patch_request:
         http_patch_request.return_value = (None, 200, '', None)
@@ -4445,7 +4425,7 @@ def test_profile(two_pubs):
         assert http_patch_request.call_args[0][1] == '{"bar": "2020-01-01"}'
 
 
-def test_set_backoffice_field(http_requests, two_pubs):
+def test_set_backoffice_field(http_requests, pub):
     Workflow.wipe()
     FormDef.wipe()
     wf = Workflow(name='xxx')
@@ -4469,7 +4449,7 @@ def test_set_backoffice_field(http_requests, two_pubs):
     formdata.data = {'00': 'HELLO'}
     formdata.just_created()
     formdata.store()
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
 
     item = SetBackofficeFieldsWorkflowStatusItem()
     item.parent = st1
@@ -4546,13 +4526,13 @@ def test_set_backoffice_field(http_requests, two_pubs):
     formdata = formdef.data_class().get(formdata.id)
     assert formdata.data['bo1'] == ''
 
-    assert two_pubs.loggederror_class.count() == 0
+    assert pub.loggederror_class.count() == 0
 
     item.fields = [{'field_id': 'bo1', 'value': '= ~ invalid python ~'}]
     item.perform(formdata)
     formdata = formdef.data_class().get(formdata.id)
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary == 'Failed to compute Python expression'
     assert logged_error.formdata_id == str(formdata.id)
     assert logged_error.expression == ' ~ invalid python ~'
@@ -4560,12 +4540,12 @@ def test_set_backoffice_field(http_requests, two_pubs):
     assert logged_error.exception_class == 'SyntaxError'
     assert logged_error.exception_message == 'invalid syntax (<string>, line 1)'
 
-    two_pubs.loggederror_class.wipe()
+    pub.loggederror_class.wipe()
     item.fields = [{'field_id': 'bo1', 'value': '{% if bad django %}'}]
     item.perform(formdata)
     formdata = formdef.data_class().get(formdata.id)
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary == 'Failed to compute template'
     assert logged_error.formdata_id == str(formdata.id)
     assert logged_error.expression == '{% if bad django %}'
@@ -4574,7 +4554,7 @@ def test_set_backoffice_field(http_requests, two_pubs):
     assert logged_error.exception_message.startswith('syntax error in Django template')
 
 
-def test_set_backoffice_field_map(http_requests, two_pubs):
+def test_set_backoffice_field_map(http_requests, pub):
     Workflow.wipe()
     FormDef.wipe()
     wf = Workflow(name='xxx')
@@ -4598,7 +4578,7 @@ def test_set_backoffice_field_map(http_requests, two_pubs):
     formdata.data = {'1': '42;10', '2': None}
     formdata.just_created()
     formdata.store()
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
 
     item = SetBackofficeFieldsWorkflowStatusItem()
     item.parent = st1
@@ -4613,13 +4593,13 @@ def test_set_backoffice_field_map(http_requests, two_pubs):
     formdata = formdef.data_class().get(formdata.id)
     assert formdata.data.get('bo1') is None
 
-    assert two_pubs.loggederror_class.count() == 0
+    assert pub.loggederror_class.count() == 0
 
     item.fields = [{'field_id': 'bo1', 'value': 'invalid value'}]
     item.perform(formdata)
     formdata = formdef.data_class().get(formdata.id)
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert (
         logged_error.summary
         == "Failed to set Map field (bo1), error: invalid coordinates 'invalid value' (missing ;)"
@@ -4627,21 +4607,21 @@ def test_set_backoffice_field_map(http_requests, two_pubs):
     assert logged_error.formdata_id == str(formdata.id)
     assert logged_error.exception_class == 'SetValueError'
     assert logged_error.exception_message == "invalid coordinates 'invalid value' (missing ;)"
-    two_pubs.loggederror_class.wipe()
+    pub.loggederror_class.wipe()
 
     item.fields = [{'field_id': 'bo1', 'value': 'XXX;YYY'}]
     item.perform(formdata)
     formdata = formdef.data_class().get(formdata.id)
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary == "Failed to set Map field (bo1), error: invalid coordinates 'XXX;YYY'"
     assert logged_error.formdata_id == str(formdata.id)
     assert logged_error.exception_class == 'SetValueError'
     assert logged_error.exception_message == "invalid coordinates 'XXX;YYY'"
-    two_pubs.loggederror_class.wipe()
+    pub.loggederror_class.wipe()
 
 
-def test_set_backoffice_field_decimal(http_requests, two_pubs):
+def test_set_backoffice_field_decimal(http_requests, pub):
     Workflow.wipe()
     FormDef.wipe()
     wf = Workflow(name='xxx')
@@ -4664,7 +4644,7 @@ def test_set_backoffice_field_decimal(http_requests, two_pubs):
     formdata.data = {'1': '1000'}
     formdata.just_created()
     formdata.store()
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
 
     item = SetBackofficeFieldsWorkflowStatusItem()
     item.parent = st1
@@ -4678,7 +4658,7 @@ def test_set_backoffice_field_decimal(http_requests, two_pubs):
     assert formdef.data_class().get(formdata.id).data['bo1'] == '1000'
 
 
-def test_set_backoffice_field_file(http_requests, two_pubs):
+def test_set_backoffice_field_file(http_requests, pub):
     Workflow.wipe()
     FormDef.wipe()
     wf = Workflow(name='xxx')
@@ -4707,7 +4687,7 @@ def test_set_backoffice_field_file(http_requests, two_pubs):
     formdata.data = {}
     formdata.just_created()
     formdata.store()
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item.perform(formdata)
     formdata = formdef.data_class().get(formdata.id)
     assert formdata.data['bo1'] is None
@@ -4723,7 +4703,7 @@ def test_set_backoffice_field_file(http_requests, two_pubs):
     formdata.just_created()
     formdata.store()
 
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item.perform(formdata)
 
     formdata = formdef.data_class().get(formdata.id)
@@ -4738,7 +4718,7 @@ def test_set_backoffice_field_file(http_requests, two_pubs):
     formdata.just_created()
     formdata.store()
 
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item.fields = [{'field_id': 'bo1', 'value': '{{form_var_file_raw}}'}]
     item.perform(formdata)
 
@@ -4752,7 +4732,7 @@ def test_set_backoffice_field_file(http_requests, two_pubs):
     formdata.just_created()
     formdata.store()
 
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item.fields = [{'field_id': 'bo1', 'value': '{{form_var_file}}'}]
     item.perform(formdata)
 
@@ -4766,7 +4746,7 @@ def test_set_backoffice_field_file(http_requests, two_pubs):
     formdata.just_created()
     formdata.store()
 
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item.fields = [{'field_id': 'bo1', 'value': '{{form_var_file|strip_metadata}}'}]
     item.perform(formdata)
 
@@ -4781,7 +4761,7 @@ def test_set_backoffice_field_file(http_requests, two_pubs):
     formdata.just_created()
     formdata.store()
 
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item.fields = [{'field_id': 'bo1', 'value': '{{form_var_file|rename_file:"foobar.jpeg"}}'}]
     item.perform(formdata)
 
@@ -4794,7 +4774,7 @@ def test_set_backoffice_field_file(http_requests, two_pubs):
     formdata.just_created()
     formdata.store()
 
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item.fields = [{'field_id': 'bo1', 'value': '{{form_var_file|rename_file:"foobar.$ext"}}'}]
     item.perform(formdata)
 
@@ -4808,7 +4788,7 @@ def test_set_backoffice_field_file(http_requests, two_pubs):
     formdata.just_created()
     formdata.store()
 
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
 
     item.fields = [{'field_id': 'bo1', 'value': '{{"xxx"|rename_file:"foobar.jpeg"}}'}]
     item.perform(formdata)
@@ -4816,7 +4796,7 @@ def test_set_backoffice_field_file(http_requests, two_pubs):
     assert 'bo1' not in formdata.data
 
     # check with a template string, into a string field
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item.fields = [{'field_id': 'bo2', 'value': '{{form_var_file}}'}]
     item.perform(formdata)
 
@@ -4831,7 +4811,7 @@ def test_set_backoffice_field_file(http_requests, two_pubs):
     assert formdata.data.get('bo1') is None
 
     # check stripping metadata
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item.fields = [
         {
             'field_id': 'bo1',
@@ -4845,7 +4825,7 @@ def test_set_backoffice_field_file(http_requests, two_pubs):
     formdata.data = {'00': upload}
     formdata.just_created()
     formdata.store()
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item.perform(formdata)
     formdata = formdef.data_class().get(formdata.id)
     assert formdata.data['bo1'].base_filename == 'new_test.jpeg'
@@ -4862,7 +4842,7 @@ def test_set_backoffice_field_file(http_requests, two_pubs):
     formdata.data = {'00': upload2}
     formdata.just_created()
     formdata.store()
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item.perform(formdata)
     formdata = formdef.data_class().get(formdata.id)
     assert formdata.data['bo1'].base_filename == 'new_test2.odt'
@@ -4871,7 +4851,7 @@ def test_set_backoffice_field_file(http_requests, two_pubs):
     assert formdata.data['bo1'].qfilename == formdata.data['00'].qfilename
 
     # check storing response as attachment
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item = WebserviceCallStatusItem()
     item.url = 'http://remote.example.net/xml'
     item.varname = 'xxx'
@@ -4884,7 +4864,7 @@ def test_set_backoffice_field_file(http_requests, two_pubs):
     assert attachment.content_type == 'text/xml'
 
     formdata = formdef.data_class().get(formdata.id)
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
     item = SetBackofficeFieldsWorkflowStatusItem()
     item.parent = st1
     item.fields = [{'field_id': 'bo1', 'value': '=attachments.xxx'}]
@@ -4935,14 +4915,14 @@ def test_set_backoffice_field_file(http_requests, two_pubs):
         item.parent = st1
         item.fields = [{'field_id': 'bo1', 'value': value}]
 
-        two_pubs.loggederror_class.wipe()
+        pub.loggederror_class.wipe()
         item.perform(formdata)
 
         formdata = formdef.data_class().get(formdata.id)
         assert formdata.data['bo1'].base_filename == 'hello.txt'
         assert formdata.data['bo1'].get_content() == b'HELLO WORLD'
-        assert two_pubs.loggederror_class.count() == 1
-        logged_error = two_pubs.loggederror_class.select()[0]
+        assert pub.loggederror_class.count() == 1
+        logged_error = pub.loggederror_class.select()[0]
         assert logged_error.summary.startswith('Failed to convert')
         assert logged_error.formdata_id == str(formdata.id)
         assert logged_error.exception_class == 'ValueError'
@@ -4957,7 +4937,7 @@ def test_set_backoffice_field_file(http_requests, two_pubs):
     assert formdata.data.get('bo3') is None
 
 
-def test_set_backoffice_field_item(two_pubs):
+def test_set_backoffice_field_item(pub):
     Workflow.wipe()
     FormDef.wipe()
     wf = Workflow(name='xxx')
@@ -5075,7 +5055,7 @@ def test_set_backoffice_field_item(two_pubs):
     assert formdata.data.get('bo1_structured') is None
 
 
-def test_set_backoffice_field_card_item(two_pubs):
+def test_set_backoffice_field_card_item(pub):
     CardDef.wipe()
     Workflow.wipe()
     FormDef.wipe()
@@ -5163,7 +5143,7 @@ def test_set_backoffice_field_card_item(two_pubs):
     assert formdata.data['bo1_structured']['attr'] == 'attr1'
 
     # reset, with unknown value
-    two_pubs.loggederror_class.wipe()
+    pub.loggederror_class.wipe()
     formdata.data = {}
     formdata.store()
     item.fields = [{'field_id': 'bo1', 'value': 'xxx'}]
@@ -5172,8 +5152,8 @@ def test_set_backoffice_field_card_item(two_pubs):
     assert formdata.data.get('bo1') is None  # invalid value is not stored
     assert formdata.data.get('bo1_display') is None
     assert formdata.data.get('bo1_structured') is None
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary.startswith('Failed to convert')
 
     # reset, and get empty value
@@ -5187,7 +5167,7 @@ def test_set_backoffice_field_card_item(two_pubs):
     assert formdata.data.get('bo1_structured') is None
 
 
-def test_set_backoffice_field_items(two_pubs):
+def test_set_backoffice_field_items(pub):
     Workflow.wipe()
     FormDef.wipe()
     wf = Workflow(name='xxx')
@@ -5292,7 +5272,7 @@ def test_set_backoffice_field_items(two_pubs):
     formdata.data['1_structured'] = formdef.fields[0].store_structured_value(formdata.data, '1')
     formdata.just_created()
     formdata.store()
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.feed(formdata)
 
     item = SetBackofficeFieldsWorkflowStatusItem()
     item.parent = st1
@@ -5312,8 +5292,8 @@ def test_set_backoffice_field_items(two_pubs):
     formdata.data['1_structured'] = formdef.fields[0].store_structured_value(formdata.data, '1')
     formdata.just_created()
     formdata.store()
-    two_pubs.substitutions.reset()
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.reset()
+    pub.substitutions.feed(formdata)
 
     item.fields = [{'field_id': 'bo1', 'value': "{{form_var_items_raw}}"}]
     item.perform(formdata)
@@ -5354,13 +5334,13 @@ def test_set_backoffice_field_items(two_pubs):
     # using an invalid value
     formdata.data = {}
     formdata.store()
-    two_pubs.loggederror_class.wipe()
+    pub.loggederror_class.wipe()
     item = SetBackofficeFieldsWorkflowStatusItem()
     item.parent = st1
     item.fields = [{'field_id': 'bo1', 'value': "=Ellipsis"}]
     item.perform(formdata)
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert 'Failed to convert' in logged_error.summary
 
     # using a string with multiple values
@@ -5377,7 +5357,7 @@ def test_set_backoffice_field_items(two_pubs):
     assert {'id': 3, 'more': 'ccc', 'text': 'cc'} in formdata.data['bo1_structured']
 
 
-def test_set_backoffice_field_date(two_pubs):
+def test_set_backoffice_field_date(pub):
     Workflow.wipe()
     FormDef.wipe()
     wf = Workflow(name='xxx')
@@ -5426,18 +5406,18 @@ def test_set_backoffice_field_date(two_pubs):
     assert datetime.date(*formdata.data['bo1'][:3]) == datetime.date(2017, 3, 23)
 
     # invalid values => do nothing
-    assert two_pubs.loggederror_class.count() == 0
+    assert pub.loggederror_class.count() == 0
     for value in ('plop', '={}', '=[]'):
         item = SetBackofficeFieldsWorkflowStatusItem()
         item.parent = st1
         item.fields = [{'field_id': 'bo1', 'value': value}]
 
-        two_pubs.loggederror_class.wipe()
+        pub.loggederror_class.wipe()
         item.perform(formdata)
         formdata = formdef.data_class().get(formdata.id)
         assert datetime.date(*formdata.data['bo1'][:3]) == datetime.date(2017, 3, 23)
-        assert two_pubs.loggederror_class.count() == 1
-        assert two_pubs.loggederror_class.select()[0].summary.startswith('Failed to convert')
+        assert pub.loggederror_class.count() == 1
+        assert pub.loggederror_class.select()[0].summary.startswith('Failed to convert')
 
     # None : empty date
     item = SetBackofficeFieldsWorkflowStatusItem()
@@ -5449,7 +5429,7 @@ def test_set_backoffice_field_date(two_pubs):
     assert formdata.data['bo1'] is None
 
 
-def test_set_backoffice_field_boolean(two_pubs):
+def test_set_backoffice_field_boolean(pub):
     Workflow.wipe()
     FormDef.wipe()
     wf = Workflow(name='xxx')
@@ -5493,7 +5473,7 @@ def test_set_backoffice_field_boolean(two_pubs):
         formdata.store()
 
 
-def test_set_backoffice_field_str_time_filter(two_pubs):
+def test_set_backoffice_field_str_time_filter(pub):
     Workflow.wipe()
     FormDef.wipe()
     wf = Workflow(name='xxx')
@@ -5536,7 +5516,7 @@ def test_set_backoffice_field_str_time_filter(two_pubs):
     formdata.store()
 
 
-def test_set_backoffice_field_block(two_pubs):
+def test_set_backoffice_field_block(pub):
     BlockDef.wipe()
     Workflow.wipe()
     FormDef.wipe()
@@ -5616,7 +5596,7 @@ def test_set_backoffice_field_block(two_pubs):
     assert formdata.data['bo2'] == formdata.data['1_display']
 
 
-def test_set_backoffice_field_block_template_tag(two_pubs):
+def test_set_backoffice_field_block_template_tag(pub):
     BlockDef.wipe()
     Workflow.wipe()
     FormDef.wipe()
@@ -5769,7 +5749,7 @@ def test_set_backoffice_field_block_template_tag(two_pubs):
     assert formdata.data['bo1_display'] == 'XNoneY'
 
 
-def test_set_backoffice_field_immediate_use(http_requests, two_pubs):
+def test_set_backoffice_field_immediate_use(http_requests, pub):
     Workflow.wipe()
     FormDef.wipe()
     wf = Workflow(name='xxx')
@@ -5799,8 +5779,8 @@ def test_set_backoffice_field_immediate_use(http_requests, two_pubs):
     item.fields = [
         {'field_id': 'bo1', 'value': '{{form_var_string}}'},
     ]
-    two_pubs.substitutions.reset()
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.reset()
+    pub.substitutions.feed(formdata)
     item.perform(formdata)
     formdata = formdef.data_class().get(formdata.id)
     assert formdata.data.get('bo1') == 'HELLO'
@@ -5808,8 +5788,8 @@ def test_set_backoffice_field_immediate_use(http_requests, two_pubs):
     item.fields = [
         {'field_id': 'bo1', 'value': 'WORLD'},
     ]
-    two_pubs.substitutions.reset()
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.reset()
+    pub.substitutions.feed(formdata)
     item.perform(formdata)
     formdata = formdef.data_class().get(formdata.id)
     assert formdata.data.get('bo1') == 'WORLD'
@@ -5818,8 +5798,8 @@ def test_set_backoffice_field_immediate_use(http_requests, two_pubs):
         {'field_id': 'bo1', 'value': 'X{{form_var_string}}X'},
         {'field_id': 'bo2', 'value': "Y{{form_var_backoffice_blah}}Y"},
     ]
-    two_pubs.substitutions.reset()
-    two_pubs.substitutions.feed(formdata)
+    pub.substitutions.reset()
+    pub.substitutions.feed(formdata)
     item.perform(formdata)
     formdata = formdef.data_class().get(formdata.id)
     assert formdata.data.get('bo1') == 'XHELLOX'
@@ -5874,16 +5854,16 @@ def test_workflow_jump_condition_migration(pub):
     assert reloaded_workflow.possible_status[0].items[0].condition == {'type': 'python', 'value': 'foobar'}
 
 
-def test_workflow_action_condition(two_pubs):
-    two_pubs._set_request(None)  # to avoid after jobs
+def test_workflow_action_condition(pub):
+    pub._set_request(None)  # to avoid after jobs
     workflow = Workflow(name='jump condition migration')
     st1 = workflow.add_status('Status1', 'st1')
     workflow.store()
 
-    role = two_pubs.role_class(name='bar1')
+    role = pub.role_class(name='bar1')
     role.store()
 
-    user = two_pubs.user_class()
+    user = pub.user_class()
     user.roles = [role.id]
     user.store()
 
@@ -5919,9 +5899,9 @@ def test_workflow_action_condition(two_pubs):
     choice.condition = {'type': 'python', 'value': 'form_var_foo == "foo"'}
     workflow.store()
 
-    with two_pubs.substitutions.temporary_feed(formdata1):
+    with pub.substitutions.temporary_feed(formdata1):
         assert FormDef.get(formdef.id).data_class().get(formdata1.id).get_actions_roles() == {role.id}
-    with two_pubs.substitutions.temporary_feed(formdata2):
+    with pub.substitutions.temporary_feed(formdata2):
         assert FormDef.get(formdef.id).data_class().get(formdata2.id).get_actions_roles() == set()
 
     assert len(FormDef.get(formdef.id).data_class().get_actionable_ids([role.id])) == 1
@@ -5936,12 +5916,12 @@ def test_workflow_action_condition(two_pubs):
     assert len(FormDef.get(formdef.id).data_class().get_actionable_ids([role.id])) == 2
 
     # bad condition
-    two_pubs.loggederror_class.wipe()
+    pub.loggederror_class.wipe()
     choice.condition = {'type': 'python', 'value': 'foobar == barfoo'}
     workflow.store()
     assert len(FormDef.get(formdef.id).data_class().get_actionable_ids([role.id])) == 0
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.occurences_count > 1  # should be 2... == 12 with pickle, 4 with sql
     assert logged_error.summary == 'Failed to evaluate condition'
     assert logged_error.exception_class == 'NameError'
@@ -6030,7 +6010,7 @@ def test_aggregation_email(pub, emails):
     )
 
 
-def test_call_external_workflow_with_evolution_linked_object(two_pubs):
+def test_call_external_workflow_with_evolution_linked_object(pub):
     FormDef.wipe()
     CardDef.wipe()
 
@@ -6126,7 +6106,7 @@ def test_call_external_workflow_with_evolution_linked_object(two_pubs):
     assert external_carddef.data_class().count() == 0
 
 
-def test_call_external_workflow_with_data_sourced_object(two_pubs, admin_user):
+def test_call_external_workflow_with_data_sourced_object(pub, admin_user):
     FormDef.wipe()
     CardDef.wipe()
 
@@ -6216,7 +6196,7 @@ def test_call_external_workflow_with_data_sourced_object(two_pubs, admin_user):
     perform_items([delete_action], formdata)
 
 
-def test_call_external_workflow_with_items_data_sourced_object(two_pubs, admin_user):
+def test_call_external_workflow_with_items_data_sourced_object(pub, admin_user):
     FormDef.wipe()
     CardDef.wipe()
 
@@ -6464,7 +6444,7 @@ def test_call_external_workflow_use_caller_variable(pub):
     assert card.data['bo0'] == 'foo@example.com'  # got called
 
 
-def test_call_external_workflow_manual_targeting(two_pubs):
+def test_call_external_workflow_manual_targeting(pub):
     FormDef.wipe()
     CardDef.wipe()
 
@@ -6560,7 +6540,7 @@ def test_call_external_workflow_manual_targeting(two_pubs):
     assert carddef.data_class().get(2).data['bo0'] is None
     assert carddef.data_class().get(3).data['bo0'] is None
     assert carddef.data_class().get(4).data['bo0'] is None
-    assert two_pubs.loggederror_class.count() == 0
+    assert pub.loggederror_class.count() == 0
 
     # configure target
     update_action.target_id = '{{ form_var_string }}'  # == '1'
@@ -6579,8 +6559,8 @@ def test_call_external_workflow_manual_targeting(two_pubs):
     assert carddef.data_class().get(2).data['bo0'] is None
     assert carddef.data_class().get(3).data['bo0'] is None
     assert carddef.data_class().get(4).data['bo0'] is None
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary == 'Could not find targeted "Data" object by id 421'
 
     # slug not or badly configured
@@ -6601,7 +6581,7 @@ def test_call_external_workflow_manual_targeting(two_pubs):
     assert carddef.data_class().get(4).data['bo0'] is None
 
 
-def test_form_update_after_backoffice_fields(sql_pub):
+def test_form_update_after_backoffice_fields(pub):
     wf = Workflow(name='wf with backoffice field')
     wf.backoffice_fields_formdef = WorkflowBackofficeFieldsFormDef(wf)
     wf.backoffice_fields_formdef.fields = [
@@ -6644,7 +6624,7 @@ def test_form_update_after_backoffice_fields(sql_pub):
     cur.close()
 
 
-def test_call_external_workflow_manual_queryset_targeting(two_pubs):
+def test_call_external_workflow_manual_queryset_targeting(pub):
     FormDef.wipe()
     CardDef.wipe()
 
@@ -6763,19 +6743,19 @@ def test_call_external_workflow_manual_queryset_targeting(two_pubs):
     )
     wf.store()
     perform_items([update_action], formdata)
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary == 'Mismatch in target objects: expected "Other data", got "Data"'
 
     # mismatch in target, with formdata
-    two_pubs.loggederror_class.wipe()
+    pub.loggederror_class.wipe()
     update_action.target_id = (
         '{{cards|objects:"%s"|filter_by:"card_string"|filter_value:"Text 2"|first}}' % carddef.url_name
     )
     wf.store()
     perform_items([update_action], formdata)
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary == 'Mismatch in target object: expected "Other data", got "Data"'
 
 
@@ -6808,7 +6788,7 @@ def test_conditional_jump_vs_tracing(pub):
     assert formdata.evolution[0].parts[-1].actions[1][1:] == ('jump', str(jump2.id))
 
 
-def test_remove_tracking_code(two_pubs):
+def test_remove_tracking_code(pub):
     formdef = FormDef()
     formdef.name = 'baz'
     formdef.enable_tracking_codes = True
diff --git a/tests/workflow/test_carddata.py b/tests/workflow/test_carddata.py
index 269f4d9f3..c08b825fa 100644
--- a/tests/workflow/test_carddata.py
+++ b/tests/workflow/test_carddata.py
@@ -38,21 +38,7 @@ def pub(request):
     return pub
 
 
-@pytest.fixture
-def two_pubs(request):
-    pub = create_temporary_pub(sql_mode=True)
-    pub.cfg['language'] = {'language': 'en'}
-    pub.write_cfg()
-    req = HTTPRequest(None, {'SERVER_NAME': 'example.net', 'SCRIPT_NAME': ''})
-    req.response.filter = {}
-    req._user = None
-    pub._set_request(req)
-    req.session = sessions.BasicSession(id=1)
-    pub.set_config(req)
-    return pub
-
-
-def test_create_carddata(two_pubs):
+def test_create_carddata(pub):
     CardDef.wipe()
     FormDef.wipe()
 
@@ -104,7 +90,7 @@ def test_create_carddata(two_pubs):
 
     assert carddef.data_class().count() == 1
 
-    errors = two_pubs.loggederror_class.select()
+    errors = pub.loggederror_class.select()
     assert len(errors) == 2
     assert any('form_var_undefined' in (error.exception_message or '') for error in errors)
     assert any('invalid date value' in (error.exception_message or '') for error in errors)
@@ -316,7 +302,7 @@ def test_create_carddata_with_links(pub):
     assert carddata2.data['2'] == str(carddata1.id)
 
 
-def test_create_carddata_with_map_field(two_pubs):
+def test_create_carddata_with_map_field(pub):
     CardDef.wipe()
     FormDef.wipe()
 
@@ -383,7 +369,7 @@ def test_create_carddata_with_map_field(two_pubs):
     assert carddef.data_class().count() == 1
     assert not carddef.data_class().select()[0].data.get('1')
 
-    errors = two_pubs.loggederror_class.select()
+    errors = pub.loggederror_class.select()
     assert len(errors) == 1
     assert any('invalid coordinates' in (error.exception_message or '') for error in errors)
 
@@ -400,16 +386,16 @@ def test_create_carddata_with_map_field(two_pubs):
     assert carddef.data_class().select()[0].data.get('1') == '2;3'
 
 
-def test_create_carddata_user_association(two_pubs):
+def test_create_carddata_user_association(pub):
     CardDef.wipe()
     FormDef.wipe()
-    two_pubs.user_class.wipe()
+    pub.user_class.wipe()
 
-    user = two_pubs.user_class()
+    user = pub.user_class()
     user.email = 'test@example.net'
     user.name_identifiers = ['xyz']
     user.store()
-    user2 = two_pubs.user_class()
+    user2 = pub.user_class()
     user2.store()
 
     carddef = CardDef()
@@ -513,15 +499,15 @@ def test_create_carddata_user_association(two_pubs):
         formdata.data = {}
         formdata.user_id = user.id
         formdata.just_created()
-        if two_pubs.loggederror_class:
-            two_pubs.loggederror_class.wipe()
+        if pub.loggederror_class:
+            pub.loggederror_class.wipe()
         formdata.perform_workflow()
 
         assert carddef.data_class().count() == 1
         assert carddef.data_class().select()[0].user is None
-        if two_pubs.loggederror_class:
-            assert two_pubs.loggederror_class.count() == 1
-            logged_error = two_pubs.loggederror_class.select()[0]
+        if pub.loggederror_class:
+            assert pub.loggederror_class.count() == 1
+            logged_error = pub.loggederror_class.select()[0]
             assert logged_error.summary == 'Failed to attach user (not found: "%s")' % invalid_user[1]
             assert logged_error.formdata_id == str(formdata.id)
 
@@ -541,10 +527,10 @@ def test_create_carddata_user_association(two_pubs):
     assert carddef.data_class().select()[0].user is None
 
 
-def test_create_carddata_map_fields_by_varname(two_pubs):
+def test_create_carddata_map_fields_by_varname(pub):
     CardDef.wipe()
     FormDef.wipe()
-    two_pubs.user_class.wipe()
+    pub.user_class.wipe()
 
     carddef = CardDef()
     carddef.name = 'My card'
@@ -739,7 +725,7 @@ def test_edit_carddata_with_linked_object(pub):
     assert card_data.data['2'] == '3'
 
 
-def test_edit_carddata_manual_targeting(two_pubs):
+def test_edit_carddata_manual_targeting(pub):
     FormDef.wipe()
     CardDef.wipe()
 
@@ -828,7 +814,7 @@ def test_edit_carddata_manual_targeting(two_pubs):
     assert carddef.data_class().get(2).data['2'] == '0'
     assert carddef.data_class().get(3).data['2'] == '0'
     assert carddef.data_class().get(4).data['2'] == '2'
-    assert two_pubs.loggederror_class.count() == 0
+    assert pub.loggederror_class.count() == 0
 
     # configure target
     edit.target_id = '{{ form_var_string }}'  # == '1'
@@ -856,7 +842,7 @@ def test_edit_carddata_manual_targeting(two_pubs):
     assert carddef.data_class().get(3).data['2'] == '0'
     assert carddef.data_class().get(4).data['2'] == '2'
     assert carddef.data_class().get(5).data['2'] == '2'
-    assert two_pubs.loggederror_class.count() == 0
+    assert pub.loggederror_class.count() == 0
 
     # target not found
     edit.target_id = '42{{ form_var_string }}'  # == '421'
@@ -885,8 +871,8 @@ def test_edit_carddata_manual_targeting(two_pubs):
     assert carddef.data_class().get(4).data['2'] == '2'
     assert carddef.data_class().get(5).data['2'] == '2'
     assert carddef.data_class().get(6).data['2'] == '2'
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary == 'Could not find targeted "Parent" object by id 421'
 
     # slug not or badly configured
@@ -1135,12 +1121,12 @@ def test_assign_carddata_with_linked_object(pub):
     assert str(card_data.user_id) == str(user.id)
 
 
-def test_assign_carddata_manual_targeting(two_pubs):
+def test_assign_carddata_manual_targeting(pub):
     FormDef.wipe()
     CardDef.wipe()
-    two_pubs.user_class.wipe()
+    pub.user_class.wipe()
 
-    user = two_pubs.user_class()
+    user = pub.user_class()
     user.email = 'test@example.net'
     user.name_identifiers = ['xyz']
     user.store()
@@ -1225,7 +1211,7 @@ def test_assign_carddata_manual_targeting(two_pubs):
     assert carddef.data_class().get(2).user_id is None
     assert carddef.data_class().get(3).user_id is None
     assert carddef.data_class().get(4).user_id is None
-    assert two_pubs.loggederror_class.count() == 0
+    assert pub.loggederror_class.count() == 0
 
     # configure target
     assign.target_id = '{{ form_var_string }}'  # == '1'
@@ -1253,7 +1239,7 @@ def test_assign_carddata_manual_targeting(two_pubs):
     assert carddef.data_class().get(3).user_id is None
     assert carddef.data_class().get(4).user_id is None
     assert carddef.data_class().get(5).user_id is None
-    assert two_pubs.loggederror_class.count() == 0
+    assert pub.loggederror_class.count() == 0
 
     # target not found
     assign.target_id = '42{{ form_var_string }}'  # == '424'
@@ -1282,8 +1268,8 @@ def test_assign_carddata_manual_targeting(two_pubs):
     assert carddef.data_class().get(4).user_id is None  # not changed
     assert carddef.data_class().get(5).user_id is None
     assert carddef.data_class().get(6).user_id is None
-    assert two_pubs.loggederror_class.count() == 1
-    logged_error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary == 'Could not find targeted "Parent" object by id 424'
 
     # slug not or badly configured
@@ -1435,16 +1421,16 @@ def test_assign_carddata_from_created_object(pub):
     assert str(carddata_reloaded.user_id) == str(user.id)
 
 
-def test_assign_carddata_user_association(two_pubs):
+def test_assign_carddata_user_association(pub):
     CardDef.wipe()
     FormDef.wipe()
-    two_pubs.user_class.wipe()
+    pub.user_class.wipe()
 
-    user = two_pubs.user_class()
+    user = pub.user_class()
     user.email = 'test@example.net'
     user.name_identifiers = ['xyz']
     user.store()
-    user2 = two_pubs.user_class()
+    user2 = pub.user_class()
     user2.store()
 
     carddef = CardDef()
@@ -1555,14 +1541,14 @@ def test_assign_carddata_user_association(two_pubs):
     formdata = FormDef.get(formdef.id).data_class()()
     formdata.data = {'0': '1'}
     formdata.just_created()
-    if two_pubs.loggederror_class:
-        two_pubs.loggederror_class.wipe()
+    if pub.loggederror_class:
+        pub.loggederror_class.wipe()
     formdata.perform_workflow()
 
     assert carddef.data_class().select()[0].user is None
-    if two_pubs.loggederror_class:
-        assert two_pubs.loggederror_class.count() == 1
-        logged_error = two_pubs.loggederror_class.select()[0]
+    if pub.loggederror_class:
+        assert pub.loggederror_class.count() == 1
+        logged_error = pub.loggederror_class.select()[0]
         assert logged_error.summary == 'Failed to attach user (not found: "zzz")'
         assert logged_error.formdata_id == str(formdata.id)
 
diff --git a/tests/workflow/test_formdata.py b/tests/workflow/test_formdata.py
index 89098d926..6c403b75e 100644
--- a/tests/workflow/test_formdata.py
+++ b/tests/workflow/test_formdata.py
@@ -34,23 +34,9 @@ def pub(request):
     return pub
 
 
-@pytest.fixture
-def two_pubs(request):
-    pub = create_temporary_pub(sql_mode=True)
-    pub.cfg['language'] = {'language': 'en'}
-    pub.write_cfg()
-    req = HTTPRequest(None, {'SERVER_NAME': 'example.net', 'SCRIPT_NAME': ''})
-    req.response.filter = {}
-    req._user = None
-    pub._set_request(req)
-    req.session = sessions.BasicSession(id=1)
-    pub.set_config(req)
-    return pub
-
-
-def test_create_formdata(two_pubs):
+def test_create_formdata(pub):
     FormDef.wipe()
-    two_pubs.tracking_code_class.wipe()
+    pub.tracking_code_class.wipe()
 
     target_formdef = FormDef()
     target_formdef.name = 'target form'
@@ -82,7 +68,7 @@ def test_create_formdata(two_pubs):
     formdata.just_created()
 
     assert target_formdef.data_class().count() == 0
-    assert two_pubs.loggederror_class.count() == 0
+    assert pub.loggederror_class.count() == 0
     # check unconfigure action do nothing
     formdata.perform_workflow()
     assert target_formdef.data_class().count() == 0
@@ -93,7 +79,7 @@ def test_create_formdata(two_pubs):
     formdata.perform_workflow()
     assert target_formdef.data_class().count() == 1
 
-    errors = two_pubs.loggederror_class.select()
+    errors = pub.loggederror_class.select()
     assert len(errors) == 2
     assert 'form_var_toto_string' in errors[0].exception_message
     assert errors[1].summary == 'Missing field: unknown (1), unknown (2)'
@@ -101,7 +87,7 @@ def test_create_formdata(two_pubs):
     assert errors[1].formdata_id == str(target_formdef.data_class().select()[0].id)
 
     # add field labels cache
-    two_pubs.loggederror_class.wipe()
+    pub.loggederror_class.wipe()
     target_formdef.data_class().wipe()
     create.formdef_slug = target_formdef.url_name
     create.cached_field_labels = {'0': 'field0', '1': 'field1', '2': 'field2'}
@@ -110,14 +96,14 @@ def test_create_formdata(two_pubs):
     formdata.perform_workflow()
     assert target_formdef.data_class().count() == 1
 
-    errors = two_pubs.loggederror_class.select()
+    errors = pub.loggederror_class.select()
     assert len(errors) == 2
     assert errors[1].summary == 'Missing field: field1, field2'
 
     # no tracking code has been created
     created_formdata = target_formdef.data_class().select()[0]
     assert created_formdata.tracking_code is None
-    assert two_pubs.tracking_code_class.count() == 0
+    assert pub.tracking_code_class.count() == 0
     # now we want one
     target_formdef.enable_tracking_codes = True
     target_formdef.store()
@@ -127,9 +113,9 @@ def test_create_formdata(two_pubs):
     assert target_formdef.data_class().count() == 1
     created_formdata = target_formdef.data_class().select()[0]
     assert created_formdata.tracking_code is not None
-    assert two_pubs.tracking_code_class.count() == 1
-    assert two_pubs.tracking_code_class.select()[0].formdef_id == target_formdef.id
-    assert two_pubs.tracking_code_class.select()[0].formdata_id == str(created_formdata.id)
+    assert pub.tracking_code_class.count() == 1
+    assert pub.tracking_code_class.select()[0].formdef_id == target_formdef.id
+    assert pub.tracking_code_class.select()[0].formdata_id == str(created_formdata.id)
 
     create.condition = {'type': 'python', 'value': '1 == 2'}
     wf.store()
@@ -160,9 +146,9 @@ def test_create_formdata_migration(pub):
     assert not hasattr(wf.possible_status[0].items[0], 'keep_user')
 
 
-def test_create_formdata_tracking_code(two_pubs, emails):
+def test_create_formdata_tracking_code(pub, emails):
     FormDef.wipe()
-    two_pubs.tracking_code_class.wipe()
+    pub.tracking_code_class.wipe()
 
     target_wf = Workflow(name='send-mail')
     st1 = target_wf.add_status('Status1', 'st1')
@@ -213,9 +199,9 @@ def test_create_formdata_tracking_code(two_pubs, emails):
     assert tracking_code in emails.get('Foobar')['payload']
 
 
-def test_create_formdata_attach_to_history(two_pubs):
+def test_create_formdata_attach_to_history(pub):
     FormDef.wipe()
-    two_pubs.tracking_code_class.wipe()
+    pub.tracking_code_class.wipe()
 
     target_formdef = FormDef()
     target_formdef.name = 'target form'
@@ -270,8 +256,8 @@ def test_create_formdata_attach_to_history(two_pubs):
     assert 'New form created (deleted, 1-1)' in str(formdata.evolution[-1].parts[0].view())
 
 
-def test_create_formdata_card_item_mapping(two_pubs):
-    two_pubs.loggederror_class.wipe()
+def test_create_formdata_card_item_mapping(pub):
+    pub.loggederror_class.wipe()
     FormDef.wipe()
     CardDef.wipe()
 
@@ -363,7 +349,7 @@ def test_create_formdata_card_item_mapping(two_pubs):
     target_formdata = target_formdef.data_class().select()[0]
     assert target_formdata.data.get('0') is None
     assert target_formdata.data.get('0_display') is None
-    assert two_pubs.loggederror_class.count() == 1
-    assert two_pubs.loggederror_class.count() == 1
-    error = two_pubs.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    assert pub.loggederror_class.count() == 1
+    error = pub.loggederror_class.select()[0]
     assert error.exception_message == "unknown card value ('XXX')"
diff --git a/tests/workflow/test_notification.py b/tests/workflow/test_notification.py
index 59d167c7a..e0b1de802 100644
--- a/tests/workflow/test_notification.py
+++ b/tests/workflow/test_notification.py
@@ -20,8 +20,9 @@ def teardown_module(module):
     clean_temporary_pub()
 
 
-def pub_fixture(**kwargs):
-    pub = create_temporary_pub(**kwargs)
+@pytest.fixture
+def pub():
+    pub = create_temporary_pub()
     pub.cfg['language'] = {'language': 'en'}
     pub.write_cfg()
     req = HTTPRequest(None, {'SERVER_NAME': 'example.net', 'SCRIPT_NAME': ''})
@@ -33,16 +34,6 @@ def pub_fixture(**kwargs):
     return pub
 
 
-@pytest.fixture
-def pub(request):
-    return pub_fixture()
-
-
-@pytest.fixture
-def sql_pub(request):
-    return pub_fixture(sql_mode=True)
-
-
 def test_notifications(pub, http_requests):
     pub.user_class.wipe()
     FormDef.wipe()
@@ -152,15 +143,15 @@ def test_notifications(pub, http_requests):
     assert set(json.loads(http_requests.get_last('body'))['name_ids']) == {'xxy1'}
 
 
-def test_notifications_to_users_template(sql_pub, http_requests):
-    sql_pub.user_class.wipe()
+def test_notifications_to_users_template(pub, http_requests):
+    pub.user_class.wipe()
     FormDef.wipe()
 
-    user1 = sql_pub.user_class(name='userA')
+    user1 = pub.user_class(name='userA')
     user1.name_identifiers = ['xxy1']
     user1.email = 'user1@example.com'
     user1.store()
-    user2 = sql_pub.user_class(name='userB')
+    user2 = pub.user_class(name='userB')
     user2.name_identifiers = ['xxy2']
     user2.email = 'user2@example.com'
     user2.store()
@@ -193,9 +184,9 @@ def test_notifications_to_users_template(sql_pub, http_requests):
     formdata.store()
 
     assert not SendNotificationWorkflowStatusItem.is_available()
-    if not sql_pub.site_options.has_section('variables'):
-        sql_pub.site_options.add_section('variables')
-    sql_pub.site_options.set('variables', 'portal_url', 'https://portal/')
+    if not pub.site_options.has_section('variables'):
+        pub.site_options.add_section('variables')
+    pub.site_options.set('variables', 'portal_url', 'https://portal/')
     assert SendNotificationWorkflowStatusItem.is_available()
 
     item = SendNotificationWorkflowStatusItem()
@@ -254,8 +245,8 @@ def test_notifications_to_users_template(sql_pub, http_requests):
     item.perform(formdata)
     assert http_requests.count() == 1
     assert set(json.loads(http_requests.get_last('body'))['name_ids']) == {'xxy1'}
-    assert sql_pub.loggederror_class.count() == 1
-    logged_error = sql_pub.loggederror_class.select()[0]
+    assert pub.loggederror_class.count() == 1
+    logged_error = pub.loggederror_class.select()[0]
     assert logged_error.summary == 'Failed to notify user (not found: "foobar")'
     assert logged_error.formdata_id == str(formdata.id)
 
@@ -264,8 +255,8 @@ def test_notifications_to_users_template(sql_pub, http_requests):
     http_requests.empty()
     item.perform(formdata)
     assert http_requests.count() == 0
-    assert sql_pub.loggederror_class.count() == 2
-    logged_error = sql_pub.loggederror_class.select()[1]
+    assert pub.loggederror_class.count() == 2
+    logged_error = pub.loggederror_class.select()[1]
     assert logged_error.summary == 'Failed to notify users, bad template result (None)'
     assert logged_error.formdata_id == str(formdata.id)
 
@@ -274,14 +265,13 @@ def test_notifications_to_users_template(sql_pub, http_requests):
     http_requests.empty()
     item.perform(formdata)
     assert http_requests.count() == 0
-    assert sql_pub.loggederror_class.count() == 3
-    logged_error = sql_pub.loggederror_class.select()[2]
+    assert pub.loggederror_class.count() == 3
+    logged_error = pub.loggederror_class.select()[2]
     assert logged_error.summary == 'Failed to compute template'
     assert logged_error.formdata_id == str(formdata.id)
 
 
-def test_notifications_target_url(sql_pub, http_requests):
-    pub = sql_pub
+def test_notifications_target_url(pub, http_requests):
     pub.substitutions.feed(pub)
     pub.user_class.wipe()
     user = pub.user_class()
-- 
2.36.1

