From bbeca248a32d505f7290a424845e0203842a9654 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laur=C3=A9line=20Gu=C3=A9rin?= <zebuline@entrouvert.com>
Date: Mon, 14 Dec 2020 12:00:12 +0100
Subject: [PATCH 1/3] tests: remove useless studio fixture

---
 tests/admin_pages/test_all.py              |  6 +++---
 tests/admin_pages/test_card.py             | 18 +++++++++---------
 tests/backoffice_pages/test_all.py         |  2 +-
 tests/backoffice_pages/test_carddata.py    | 16 ++++++++--------
 tests/backoffice_pages/test_custom_view.py |  2 +-
 tests/conftest.py                          |  6 ------
 6 files changed, 22 insertions(+), 28 deletions(-)

diff --git a/tests/admin_pages/test_all.py b/tests/admin_pages/test_all.py
index 6862455c..01ee9b46 100644
--- a/tests/admin_pages/test_all.py
+++ b/tests/admin_pages/test_all.py
@@ -635,7 +635,7 @@ def test_settings_disabled_screens(pub):
     assert 'Theme' not in resp.text
 
 
-def test_settings_export_import(pub, studio):
+def test_settings_export_import(pub):
     def wipe():
         FormDef.wipe()
         CardDef.wipe()
@@ -1409,7 +1409,7 @@ def test_postgresql_settings(pub):
     assert pub.cfg['postgresql']['port'] == 5432
 
 
-def test_studio_home(pub, studio):
+def test_studio_home(pub):
     create_superuser(pub)
     app = login(get_app(pub))
     resp = app.get('/backoffice/')
@@ -1434,7 +1434,7 @@ def test_studio_home(pub, studio):
     assert 'studio' not in resp.text
 
 
-def test_studio_workflows(pub, studio):
+def test_studio_workflows(pub):
     create_superuser(pub)
     app = login(get_app(pub))
     resp = app.get('/backoffice/workflows/')
diff --git a/tests/admin_pages/test_card.py b/tests/admin_pages/test_card.py
index 82bc381d..0e4127dd 100644
--- a/tests/admin_pages/test_card.py
+++ b/tests/admin_pages/test_card.py
@@ -43,7 +43,7 @@ def teardown_module(module):
     clean_temporary_pub()
 
 
-def test_cards_list(pub, studio):
+def test_cards_list(pub):
     create_superuser(pub)
 
     CardDef.wipe()
@@ -84,7 +84,7 @@ def test_cards_list(pub, studio):
     assert '<h2>Bar</h2>' in resp.text
 
 
-def test_cards_new(pub, studio):
+def test_cards_new(pub):
     CardDef.wipe()
     create_superuser(pub)
     app = login(get_app(pub))
@@ -99,7 +99,7 @@ def test_cards_new(pub, studio):
     assert CardDef.get(1).disabled is False
 
 
-def test_cards_delete(pub, studio):
+def test_cards_delete(pub):
     CardDef.wipe()
     carddef = CardDef()
     carddef.name = 'card title'
@@ -127,7 +127,7 @@ def test_cards_delete(pub, studio):
     carddata.remove_self()  # don't keep leftovers
 
 
-def test_cards_duplicate(pub, studio):
+def test_cards_duplicate(pub):
     CardDef.wipe()
     carddef = CardDef()
     carddef.name = 'card title'
@@ -141,7 +141,7 @@ def test_cards_duplicate(pub, studio):
     assert CardDef.get(2).disabled is False
 
 
-def test_card_workflow_change(pub, studio):
+def test_card_workflow_change(pub):
     Workflow.wipe()
     workflow = Workflow(name='Workflow Two')
     workflow.add_status('plop')
@@ -179,7 +179,7 @@ def test_card_workflow_change(pub, studio):
     resp = resp.form.submit('submit').follow()
 
 
-def test_card_digest_template(pub, studio):
+def test_card_digest_template(pub):
     create_superuser(pub)
 
     CardDef.wipe()
@@ -239,7 +239,7 @@ def test_card_digest_template(pub, studio):
     assert 'Existing cards will be updated in the background.' not in resp.text
 
 
-def test_card_category(pub, studio):
+def test_card_category(pub):
     create_superuser(pub)
 
     CardDef.wipe()
@@ -278,7 +278,7 @@ def test_card_category(pub, studio):
     assert '<span class="label">Category</span> <span class="value">Bar</span>' in resp.text
 
 
-def test_card_user_support(pub, studio):
+def test_card_user_support(pub):
     create_superuser(pub)
 
     CardDef.wipe()
@@ -299,7 +299,7 @@ def test_card_user_support(pub, studio):
     assert '<span class="label">User support</span> <span class="value">Optional</span>' in resp.text
 
 
-def test_card_custom_view_data_source(pub, studio):
+def test_card_custom_view_data_source(pub):
     user = create_superuser(pub)
     Role.wipe()
     role = Role(name='foobar')
diff --git a/tests/backoffice_pages/test_all.py b/tests/backoffice_pages/test_all.py
index f39ceb04..e97c232f 100644
--- a/tests/backoffice_pages/test_all.py
+++ b/tests/backoffice_pages/test_all.py
@@ -5591,7 +5591,7 @@ def test_backoffice_create_formdata_map_fields_by_varname(pub, create_formdata):
         assert not pq('.wf-links')
 
 
-def test_backoffice_create_carddata_from_formdata(pub, studio):
+def test_backoffice_create_carddata_from_formdata(pub):
     CardDef.wipe()
     FormDef.wipe()
 
diff --git a/tests/backoffice_pages/test_carddata.py b/tests/backoffice_pages/test_carddata.py
index 5f0a61a3..70618ea7 100644
--- a/tests/backoffice_pages/test_carddata.py
+++ b/tests/backoffice_pages/test_carddata.py
@@ -50,7 +50,7 @@ def teardown_module(module):
     clean_temporary_pub()
 
 
-def test_carddata_management(pub, studio):
+def test_carddata_management(pub):
     CardDef.wipe()
     user = create_user(pub)
     app = login(get_app(pub))
@@ -124,7 +124,7 @@ def test_carddata_management(pub, studio):
     assert resp.text.count('<tr') == 2  # header + row of data
 
 
-def test_carddata_management_categories(pub, studio):
+def test_carddata_management_categories(pub):
     user = create_user(pub)
 
     CardDef.wipe()
@@ -169,7 +169,7 @@ def test_carddata_management_categories(pub, studio):
     assert '<h3>Bar</h3>' in resp.text
 
 
-def test_carddata_management_user_support(pub, studio):
+def test_carddata_management_user_support(pub):
     user = create_user(pub)
 
     CardDef.wipe()
@@ -198,7 +198,7 @@ def test_carddata_management_user_support(pub, studio):
     assert 'user_id' in resp.form.fields
 
 
-def test_studio_card_item_link(pub, studio):
+def test_studio_card_item_link(pub):
     user = create_user(pub)
     CardDef.wipe()
     carddef = CardDef()
@@ -261,7 +261,7 @@ def test_studio_card_item_link(pub, studio):
         resp.click('card plop')
 
 
-def test_backoffice_cards_import_data_from_csv(pub, studio):
+def test_backoffice_cards_import_data_from_csv(pub):
     user = create_user(pub)
 
     data_source = {
@@ -377,7 +377,7 @@ def test_backoffice_cards_import_data_from_csv(pub, studio):
     assert card2.data['5'].tm_mday == 3
 
 
-def test_backoffice_cards_import_data_csv_user_support(pub, studio):
+def test_backoffice_cards_import_data_csv_user_support(pub):
     user = create_user(pub)
     user.name_identifiers = [str(uuid.uuid4())]
     user.store()
@@ -478,7 +478,7 @@ def test_backoffice_cards_import_data_csv_invalid_columns(pub):
     assert '(line numbers 4, 5, 7, 8, 9 and more)' in resp.text
 
 
-def test_backoffice_cards_wscall_failure_display(http_requests, pub, studio):
+def test_backoffice_cards_wscall_failure_display(http_requests, pub):
     if not pub.is_using_postgresql():
         pytest.skip('this requires SQL')
         return
@@ -543,7 +543,7 @@ def test_backoffice_cards_wscall_failure_display(http_requests, pub, studio):
     assert pub.loggederror_class.select()[0].get_formdata().data == {'1': 'plop'}
 
 
-def test_block_card_item_link(pub, studio, blocks_feature):
+def test_block_card_item_link(pub, blocks_feature):
     user = create_user(pub)
     CardDef.wipe()
     carddef = CardDef()
diff --git a/tests/backoffice_pages/test_custom_view.py b/tests/backoffice_pages/test_custom_view.py
index e5735998..688216f1 100644
--- a/tests/backoffice_pages/test_custom_view.py
+++ b/tests/backoffice_pages/test_custom_view.py
@@ -459,7 +459,7 @@ def test_backoffice_missing_custom_view(pub):
     assert resp.location == 'http://example.net/backoffice/management/form-title/1/?plop'
 
 
-def test_carddata_custom_view(pub, studio):
+def test_carddata_custom_view(pub):
     user = create_user(pub)
 
     CardDef.wipe()
diff --git a/tests/conftest.py b/tests/conftest.py
index 3b89bc4e..bede3fb2 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -43,12 +43,6 @@ def welco_url(request, pub):
     return site_options(request, pub, 'options', 'welco_url', 'http://welco.example.net')
 
 
-@pytest.fixture
-def studio(request, pub):
-    # studio enabled is now the default
-    return
-
-
 @pytest.fixture
 def blocks_feature(request, pub):
     return site_options(request, pub, 'options', 'fields-blocks', 'true')
-- 
2.28.0

