diff --git a/tests/test_communities/conftest.py b/tests/test_communities/conftest.py index cd8fa5b..3bc2e67 100644 --- a/tests/test_communities/conftest.py +++ b/tests/test_communities/conftest.py @@ -59,8 +59,8 @@ ] @pytest.fixture(autouse=True) -def init_cf(init_cf): - return init_cf +def init_communities_cf(init_communities_cf): + return init_communities_cf @pytest.fixture(scope="module", autouse=True) def location(location): diff --git a/tests/test_communities/test_community_inclusion.py b/tests/test_communities/test_community_inclusion.py index 607e261..4d7e2d4 100644 --- a/tests/test_communities/test_community_inclusion.py +++ b/tests/test_communities/test_community_inclusion.py @@ -1,5 +1,6 @@ import pytest from invenio_access.permissions import system_identity +from pytest_oarepo.communities.functions import community_get_or_create from oarepo_communities.errors import CommunityNotIncludedException @@ -7,16 +8,15 @@ def test_include( logged_client, community_owner, - community_with_workflow_factory, community_inclusion_service, record_service, search_clear, ): owner_client = logged_client(community_owner) - community_1 = community_with_workflow_factory("comm1", community_owner) - community_2 = community_with_workflow_factory("comm2", community_owner) - community_3 = community_with_workflow_factory("comm3", community_owner) + community_1 = community_get_or_create(community_owner, slug="comm1") + community_2 = community_get_or_create(community_owner, slug="comm2") + community_3 = community_get_or_create(community_owner, slug="comm3") response = owner_client.post(f"/communities/{community_1.id}/thesis", json={}) @@ -51,15 +51,14 @@ def test_include( def test_remove( logged_client, community_owner, - community_with_workflow_factory, community_inclusion_service, record_service, search_clear, ): owner_client = logged_client(community_owner) - community_1 = community_with_workflow_factory("comm1", community_owner) - community_2 = community_with_workflow_factory("comm2", community_owner) + community_1 = community_get_or_create(community_owner, "comm1") + community_2 = community_get_or_create(community_owner, "comm2") response = owner_client.post(f"/communities/{community_1.id}/thesis", json={}) record_id = response.json["id"] diff --git a/tests/test_communities/test_community_records.py b/tests/test_communities/test_community_records.py index 227d9eb..f824a5f 100644 --- a/tests/test_communities/test_community_records.py +++ b/tests/test_communities/test_community_records.py @@ -1,3 +1,5 @@ +from pytest_oarepo.communities.functions import community_get_or_create, invite + from thesis.records.api import ThesisDraft, ThesisRecord @@ -41,15 +43,14 @@ def test_create_record_in_community_without_model_in_url( def test_search( logged_client, community_owner, - community_with_workflow_factory, published_record_with_community_factory, record_service, search_clear, ): owner_client = logged_client(community_owner) - community_1 = community_with_workflow_factory("comm1", community_owner) - community_2 = community_with_workflow_factory("comm2", community_owner) + community_1 = community_get_or_create(community_owner, "comm1") + community_2 = community_get_or_create(community_owner, "comm2") record1 = published_record_with_community_factory(owner_client, community_1.id) record2 = published_record_with_community_factory(owner_client, community_2.id) @@ -70,8 +71,8 @@ def test_search( assert len(response_draft1.json["hits"]["hits"]) == 1 assert len(response_draft2.json["hits"]["hits"]) == 1 - assert response_record1.json["hits"]["hits"][0]["id"] == record1.json["id"] - assert response_record2.json["hits"]["hits"][0]["id"] == record2.json["id"] + assert response_record1.json["hits"]["hits"][0]["id"] == record1["id"] + assert response_record2.json["hits"]["hits"][0]["id"] == record2["id"] # todo tests for search links @@ -80,15 +81,14 @@ def test_search( def test_search_model( logged_client, community_owner, - community_with_workflow_factory, published_record_with_community_factory, record_service, search_clear, ): owner_client = logged_client(community_owner) - community_1 = community_with_workflow_factory("comm1", community_owner) - community_2 = community_with_workflow_factory("comm2", community_owner) + community_1 = community_get_or_create(community_owner, "comm1") + community_2 = community_get_or_create(community_owner, "comm2") record1 = published_record_with_community_factory(owner_client, community_1.id) record2 = published_record_with_community_factory(owner_client, community_2.id) @@ -102,29 +102,28 @@ def test_search_model( assert len(response_record1.json["hits"]["hits"]) == 1 assert len(response_record2.json["hits"]["hits"]) == 1 - assert response_record1.json["hits"]["hits"][0]["id"] == record1.json["id"] - assert response_record2.json["hits"]["hits"][0]["id"] == record2.json["id"] + assert response_record1.json["hits"]["hits"][0]["id"] == record1["id"] + assert response_record2.json["hits"]["hits"][0]["id"] == record2["id"] def test_user_search( logged_client, community_owner, users, - community_with_workflow_factory, - inviter, + draft_with_community_factory, search_clear, ): community_reader = users[0] owner_client = logged_client(community_owner) reader_client = logged_client(community_reader) - community_1 = community_with_workflow_factory("comm1", community_owner) - community_2 = community_with_workflow_factory("comm2", community_owner) - inviter(community_reader, community_1.id, "reader") + community_1 = community_get_or_create(community_owner, "comm1") + community_2 = community_get_or_create(community_owner, "comm2") + invite(community_reader, community_1.id, "reader") - record1 = owner_client.post(f"/communities/{community_1.id}/thesis", json={}).json - record2 = owner_client.post(f"/communities/{community_2.id}/thesis", json={}).json - record3 = reader_client.post(f"/communities/{community_1.id}/thesis", json={}).json + record1 = draft_with_community_factory(owner_client, str(community_1.id)) + record2 = draft_with_community_factory(owner_client, str(community_2.id)) + record3 = draft_with_community_factory(reader_client, str(community_1.id)) ThesisRecord.index.refresh() ThesisDraft.index.refresh() @@ -149,22 +148,21 @@ def test_user_search_model( logged_client, community_owner, users, - community_with_workflow_factory, + draft_with_community_factory, record_service, - inviter, search_clear, ): community_reader = users[0] owner_client = logged_client(community_owner) reader_client = logged_client(community_reader) - community_1 = community_with_workflow_factory("comm1", community_owner) - community_2 = community_with_workflow_factory("comm2", community_owner) - inviter(community_reader, community_1.id, "reader") + community_1 = community_get_or_create(community_owner, "comm1") + community_2 = community_get_or_create(community_owner, "comm2") + invite(community_reader, community_1.id, "reader") - record1 = owner_client.post(f"/communities/{community_1.id}/thesis", json={}).json - record2 = owner_client.post(f"/communities/{community_2.id}/thesis", json={}).json - record3 = reader_client.post(f"/communities/{community_1.id}/thesis", json={}).json + record1 = draft_with_community_factory(owner_client, str(community_1.id)) + record2 = draft_with_community_factory(owner_client, str(community_2.id)) + record3 = draft_with_community_factory(reader_client, str(community_1.id)) ThesisRecord.index.refresh() ThesisDraft.index.refresh() @@ -182,7 +180,6 @@ def test_user_search_model( def test_search_links( logged_client, community_owner, - community_with_workflow_factory, published_record_with_community_factory, record_service, search_clear, @@ -191,7 +188,7 @@ def test_search_links( owner_client = logged_client(community_owner) - community_1 = community_with_workflow_factory("comm1", community_owner) + community_1 = community_get_or_create(community_owner, "comm1") for _ in range(30): published_record_with_community_factory(owner_client, community_1.id) @@ -240,16 +237,14 @@ def check_links(model_suffix): def test_search_ui_serialization( logged_client, community_owner, - community_with_workflow_factory, published_record_with_community_factory, record_service, - inviter, search_clear, ): owner_client = logged_client(community_owner) - community_1 = community_with_workflow_factory("comm1", community_owner) - community_2 = community_with_workflow_factory("comm2", community_owner) + community_1 = community_get_or_create(community_owner, "comm1") + community_2 = community_get_or_create(community_owner, "comm2") record1 = published_record_with_community_factory(owner_client, community_1.id) record2 = published_record_with_community_factory(owner_client, community_2.id) diff --git a/tests/test_communities/test_community_requests.py b/tests/test_communities/test_community_requests.py index b4eb91b..51c82ac 100644 --- a/tests/test_communities/test_community_requests.py +++ b/tests/test_communities/test_community_requests.py @@ -1,4 +1,5 @@ import pytest +from pytest_oarepo.communities.functions import invite, community_get_or_create from pytest_oarepo.functions import link2testclient from oarepo_communities.errors import ( @@ -46,16 +47,14 @@ def _init_env( logged_client, community_owner, community_reader, - community_with_permission_cf_factory, - inviter, ): reader_client = logged_client(community_reader) owner_client = logged_client(community_owner) - community_1 = community_with_permission_cf_factory("comm1", community_owner) - community_2 = community_with_permission_cf_factory("comm2", community_owner) - inviter(community_reader, community_1.data["id"], "reader") - inviter(community_reader, community_2.data["id"], "reader") + community_1 = community_get_or_create(community_owner, "comm1") + community_2 = community_get_or_create(community_owner, "comm2") + invite(community_reader, community_1.data["id"], "reader") + invite(community_reader, community_2.data["id"], "reader") return reader_client, owner_client, community_1, community_2 @@ -65,19 +64,18 @@ def test_community_publish( community_owner, users, community, - inviter, draft_with_community_factory, - submit_request_by_link, + submit_request, search_clear, ): community_reader = users[0] - inviter(community_reader, community.id, "reader") + invite(community_reader, community.id, "reader") reader_client = logged_client(community_reader) owner_client = logged_client(community_owner) record = draft_with_community_factory(reader_client, community.id) - record_id = record.json["id"] - submit = submit_request_by_link(reader_client, record, "publish_draft") + record_id = record["id"] + submit = submit_request(reader_client, record_id, "publish_draft") _accept_request( reader_client, type="publish_draft", @@ -102,19 +100,18 @@ def test_community_delete( community_owner, users, community, - inviter, published_record_with_community_factory, - submit_request_by_link, + submit_request, search_clear, ): community_reader = users[0] reader_client = logged_client(community_reader) owner_client = logged_client(community_owner) - inviter(community_reader, community.id, "reader") + invite(community_reader, community.id, "reader") record = published_record_with_community_factory(reader_client, community.id) - record_id = record.json["id"] + record_id = record["id"] - submit = submit_request_by_link(reader_client, record, "delete_published_record") + submit = submit_request(reader_client, record_id, "delete_published_record") _accept_request( reader_client, type="delete_published_record", @@ -137,10 +134,8 @@ def test_community_migration( logged_client, community_owner, users, - community_with_workflow_factory, published_record_with_community_factory, - submit_request_by_link, - inviter, + submit_request, search_clear, ): community_reader = users[0] @@ -148,16 +143,14 @@ def test_community_migration( logged_client, community_owner, community_reader, - community_with_workflow_factory, - inviter, ) record = published_record_with_community_factory(reader_client, community_1.id) - record_id = record.json["id"] + record_id = record["id"] record_before = reader_client.get(f"/thesis/{record_id}") - submit = submit_request_by_link( + submit = submit_request( reader_client, - record, + record_id, "initiate_community_migration", create_additional_data={"payload": {"community": str(community_2.id)}}, ) @@ -191,11 +184,9 @@ def test_community_submission_secondary( logged_client, community_owner, users, - community_with_workflow_factory, - inviter, published_record_with_community_factory, - create_request_by_link, - submit_request_by_link, + create_request, + submit_request, search_clear, ): community_reader = users[0] @@ -203,23 +194,21 @@ def test_community_submission_secondary( logged_client, community_owner, community_reader, - community_with_workflow_factory, - inviter, ) record = published_record_with_community_factory(reader_client, community_1.id) - record_id = record.json["id"] + record_id = record["id"] record_before = owner_client.get(f"/thesis/{record_id}") with pytest.raises(CommunityAlreadyIncludedException): - create_request_by_link( + create_request( reader_client, - record, + record_id, "secondary_community_submission", additional_data={"payload": {"community": str(community_1.id)}}, ) - submit = submit_request_by_link( + submit = submit_request( reader_client, - record, + record_id, "secondary_community_submission", create_additional_data={"payload": {"community": str(community_2.id)}}, ) @@ -247,11 +236,9 @@ def test_remove_secondary( logged_client, community_owner, users, - community_with_workflow_factory, - inviter, published_record_with_community_factory, - create_request_by_link, - submit_request_by_link, + create_request, + submit_request, get_request_type, search_clear, ): @@ -260,16 +247,14 @@ def test_remove_secondary( logged_client, community_owner, community_reader, - community_with_workflow_factory, - inviter, ) record = published_record_with_community_factory(reader_client, community_1.id) - record_id = record.json["id"] + record_id = record["id"] - submit_request_by_link( + submit_request( reader_client, - record, + record_id, "secondary_community_submission", create_additional_data={"payload": {"community": str(community_2.id)}}, ) @@ -281,16 +266,16 @@ def test_remove_secondary( # todo this should not work - it should not produce a link with pytest.raises(PrimaryCommunityException): - create_request_by_link( + create_request( reader_client, - record, + record_id, "remove_secondary_community", additional_data={"payload": {"community": str(community_1.id)}}, ) - submit_request_by_link( + submit_request( reader_client, - record, + record_id, "remove_secondary_community", create_additional_data={"payload": {"community": str(community_2.id)}}, ) @@ -313,7 +298,7 @@ def test_remove_secondary( # assert link is not present applicable_requests = reader_client.get( - link2testclient(record.json["links"]["applicable-requests"]) + link2testclient(record["links"]["applicable-requests"]) ).json["hits"]["hits"] assert get_request_type(applicable_requests, "remove_secondary_community") is None with pytest.raises(CommunityNotIncludedException): @@ -328,19 +313,19 @@ def test_community_role_ui_serialization( community_owner, users, community, - inviter, draft_with_community_factory, - submit_request_by_link, + submit_request, ui_serialized_community_role, search_clear, ): community_reader = users[0] reader_client = logged_client(community_reader) owner_client = logged_client(community_owner) - inviter(community_reader, community.id, "reader") + invite(community_reader, community.id, "reader") record = draft_with_community_factory(reader_client, community.id) + record_id = record["id"] - submit = submit_request_by_link(reader_client, record, "publish_draft") + submit = submit_request(reader_client, record_id, "publish_draft") def compare_result(result): assert result.items() >= ui_serialized_community_role(community.id).items() @@ -353,7 +338,7 @@ def compare_result(result): ) request = owner_client.get( - f"/requests/extended/{submit.json['id']}", + f"/requests/extended/{submit['id']}", headers={"Accept": "application/vnd.inveniordm.v1+json"}, ) diff --git a/tests/test_communities/test_param_interpreters.py b/tests/test_communities/test_param_interpreters.py index 8b2eddb..d3f2a35 100644 --- a/tests/test_communities/test_param_interpreters.py +++ b/tests/test_communities/test_param_interpreters.py @@ -1,25 +1,26 @@ +from pytest_oarepo.communities.functions import invite, community_get_or_create + + def test_community_role_param_interpreter( logged_client, community_owner, users, - community_with_workflow_factory, record_service, draft_with_community_factory, - create_request_by_link, - submit_request_by_link, - inviter, + create_request, + submit_request, search_clear, ): community_reader = users[0] community_curator = users[1] owner_client = logged_client(community_owner) - community_1 = community_with_workflow_factory("comm1", community_owner) - community_2 = community_with_workflow_factory("comm2", community_owner) - community_3 = community_with_workflow_factory("comm3", community_curator) - inviter(community_reader, community_1.id, "reader") - inviter(community_reader, community_2.id, "reader") - inviter(community_reader, community_3.id, "reader") + community_1 = community_get_or_create(community_owner, "comm1") + community_2 = community_get_or_create(community_owner, "comm2") + community_3 = community_get_or_create(community_curator, "comm3") + invite(community_reader, community_1.id, "reader") + invite(community_reader, community_2.id, "reader") + invite(community_reader, community_3.id, "reader") record1 = draft_with_community_factory(owner_client, str(community_1.id)) record2 = draft_with_community_factory(owner_client, str(community_2.id)) @@ -29,9 +30,9 @@ def test_community_role_param_interpreter( custom_workflow="curator_publish", # owner is creator but not receiver of the third request ) - response_1 = submit_request_by_link(owner_client, record1, "publish_draft") - response_2 = create_request_by_link(owner_client, record2, "publish_draft") - response_3 = submit_request_by_link(owner_client, record3, "publish_draft") + response_1 = submit_request(owner_client, record1["id"], "publish_draft") + response_2 = create_request(owner_client, record2["id"], "publish_draft") + response_3 = submit_request(owner_client, record3["id"], "publish_draft") search_unfiltered = owner_client.get("/requests/") assert len(search_unfiltered.json["hits"]["hits"]) == 3 diff --git a/tests/test_communities/test_permissions.py b/tests/test_communities/test_permissions.py index 867c395..dd27ad7 100644 --- a/tests/test_communities/test_permissions.py +++ b/tests/test_communities/test_permissions.py @@ -5,6 +5,8 @@ from invenio_communities.communities.records.api import Community from invenio_communities.proxies import current_communities from invenio_users_resources.proxies import current_users_service +from pytest_oarepo.communities.functions import community_get_or_create, invite, set_community_workflow +from pytest_oarepo.constants import DEFAULT_RECORD_WITH_WORKFLOW_JSON from pytest_oarepo.functions import link2testclient from tests.test_communities.test_community_requests import _accept_request @@ -13,26 +15,21 @@ def test_disabled_endpoints( logged_client, community_owner, - community_with_workflow_factory, + draft_with_community_factory, published_record_with_community_factory, record_service, - default_record_with_workflow_json, search_clear, ): owner_client = logged_client(community_owner) # create should work only through community - create = owner_client.post("/thesis/", json=default_record_with_workflow_json) + create = owner_client.post("/thesis/", json=DEFAULT_RECORD_WITH_WORKFLOW_JSON) assert create.status_code == 400 - - community_1 = community_with_workflow_factory("comm1", community_owner) - draft = owner_client.post( - f"/communities/{community_1.id}/thesis", json=default_record_with_workflow_json - ).json + community_1 = community_get_or_create(community_owner, "comm1") + draft = draft_with_community_factory(owner_client, community_1.id) published_record = published_record_with_community_factory(owner_client, community_1.id) - publish = owner_client.post(f"/thesis/{draft['id']}/draft/actions/publish") - delete = owner_client.delete(f"/thesis/{published_record.json['id']}") + delete = owner_client.delete(f"/thesis/{published_record['id']}") assert publish.status_code == 403 assert delete.status_code == 403 @@ -44,21 +41,10 @@ def service_config(): return ThesisServiceConfig -@pytest.fixture() -def requests_service(): - # from invenio_requests.services.requests.service import RequestsService - from invenio_requests.proxies import current_requests_service - - return current_requests_service - - def test_default_community_workflow_changed( logged_client, community_owner, users, - community_with_workflow_factory, - inviter, - set_community_workflow, service_config, draft_with_community_factory, search_clear, @@ -67,20 +53,17 @@ def test_default_community_workflow_changed( owner_client = logged_client(community_owner) reader_client = logged_client(community_reader) - community_1 = community_with_workflow_factory("comm1", community_owner) - community_2 = community_with_workflow_factory( - "comm2", - community_owner, - ) - inviter(community_reader, community_1.id, "reader") - inviter(community_reader, community_2.id, "reader") + community_1 = community_get_or_create(community_owner, "comm1") + community_2 = community_get_or_create(community_owner, "comm2") + invite(community_reader, community_1.id, "reader") + invite(community_reader, community_2.id, "reader") record1 = draft_with_community_factory(owner_client, community_1.id) record2 = draft_with_community_factory(owner_client, community_2.id) record4 = draft_with_community_factory(reader_client, community_1.id) request_should_be_allowed = owner_client.post( - f"/thesis/{record1.json['id']}/draft/requests/publish_draft" + f"/thesis/{record1['id']}/draft/requests/publish_draft" ) submit = owner_client.post( link2testclient(request_should_be_allowed.json["links"]["actions"]["submit"]) @@ -96,8 +79,8 @@ def test_default_community_workflow_changed( # old permissions should not allow this for reader, but reader is in editors so it should be fine with new ones update_draft = reader_client.put( - f"/thesis/{record4.json['id']}/draft", - json=record4.json | {"metadata": {"title": "should do"}}, + f"/thesis/{record4['id']}/draft", + json=record4 | {"metadata": {"title": "should do"}}, ) assert update_draft.status_code == 200 assert update_draft.json["metadata"]["title"] == "should do" @@ -106,11 +89,11 @@ def test_default_community_workflow_changed( record = Community.get_record(str(community_1.id)) assert record.custom_fields["workflow"] == "no" request_should_still_work = owner_client.post( - f"/thesis/{record2.json['id']}/draft/requests/publish_draft" + f"/thesis/{record2['id']}/draft/requests/publish_draft" ) record5 = draft_with_community_factory(owner_client, community_1.id) request_should_be_forbidden = owner_client.post( - f"/thesis/{record5.json['id']}/draft/requests/publish_draft" + f"/thesis/{record5['id']}/draft/requests/publish_draft" ) assert request_should_still_work.status_code == 201 assert request_should_be_forbidden.status_code == 403 @@ -123,8 +106,6 @@ def test_default_community_workflow_changed( def test_can_possibly_create_in_community( community_owner, users, - community_with_workflow_factory, - inviter, service_config, record_service, search_clear, @@ -133,8 +114,8 @@ def test_can_possibly_create_in_community( # allowing curator, which should allow curator to deposit too community_curator = users[0] rando_user = users[1] - community_1 = community_with_workflow_factory("comm1", community_owner) - inviter(community_curator, community_1.id, "curator") + community_1 = community_get_or_create(community_owner, "comm1") + invite(community_curator, community_1.id, "curator") record_service.require_permission(community_owner.identity, "view_deposit_page") with pytest.raises(PermissionDeniedError): record_service.require_permission( @@ -143,16 +124,13 @@ def test_can_possibly_create_in_community( with pytest.raises(PermissionDeniedError): record_service.require_permission(rando_user.identity, "view_deposit_page") - community_2 = community_with_workflow_factory( - "comm2", - community_owner, - ) + community_2 = community_get_or_create(community_owner, "comm2") current_communities.service.update( community_owner.identity, id_=community_2.id, data=community_2.data | {"custom_fields": {"workflow": "custom"}}, ) - inviter(community_curator, community_2.id, "curator") + invite(community_curator, community_2.id, "curator") community2read = current_communities.service.read( community_curator.identity, community_2.id ) @@ -169,7 +147,6 @@ def _record_owners_in_record_community_test( community_owner, users, logged_client, - community_with_workflow_factory, community_inclusion_service, draft_with_community_factory, record_service, @@ -179,9 +156,9 @@ def _record_owners_in_record_community_test( # tries to read record when user in record's primary community, in noth primary and secondary, in secondary and # in none community_curator = users[0] - community_1 = community_with_workflow_factory("comm1", community_owner) - community_2 = community_with_workflow_factory("comm2", community_owner) - community_3 = community_with_workflow_factory("comm3", community_curator) + community_1 = community_get_or_create(community_owner, "comm1") + community_2 = community_get_or_create(community_owner, "comm2") + community_3 = community_get_or_create(community_curator, "comm3") owner_client = logged_client(community_owner) @@ -190,39 +167,40 @@ def _record_owners_in_record_community_test( community_1.id, custom_workflow=workflow, ) + record_id = record["id"] - read_com1 = owner_client.get(f"/thesis/{record.json['id']}/draft?expand=true") + read_com1 = owner_client.get(f"/thesis/{record_id}/draft?expand=true") community_inclusion_service.include( - record_service.read_draft(system_identity, record.json["id"])._record, + record_service.read_draft(system_identity, record_id)._record, community_2.id, record_service=record_service, default=False, ) - read_com2 = owner_client.get(f"/thesis/{record.json['id']}/draft?expand=true") + read_com2 = owner_client.get(f"/thesis/{record_id}/draft?expand=true") community_inclusion_service.include( - record_service.read_draft(system_identity, record.json["id"])._record, + record_service.read_draft(system_identity, record_id)._record, community_3.id, record_service=record_service, default=True, ) community_inclusion_service.remove( - record_service.read_draft(system_identity, record.json["id"])._record, + record_service.read_draft(system_identity, record_id)._record, community_1.id, record_service=record_service ) - read_com3 = owner_client.get(f"/thesis/{record.json['id']}/draft?expand=true") + read_com3 = owner_client.get(f"/thesis/{record_id}/draft?expand=true") community_inclusion_service.remove( - record_service.read_draft(system_identity, record.json["id"])._record, + record_service.read_draft(system_identity, record_id)._record, community_2.id, record_service=record_service ) - read_com4 = owner_client.get(f"/thesis/{record.json['id']}/draft?expand=true") + read_com4 = owner_client.get(f"/thesis/{record_id}/draft?expand=true") assert read_com1.status_code == results[0] assert read_com2.status_code == results[1] @@ -234,7 +212,6 @@ def test_record_owners_in_record_community_needs( community_owner, users, logged_client, - community_with_workflow_factory, community_inclusion_service, draft_with_community_factory, record_service, @@ -244,7 +221,6 @@ def test_record_owners_in_record_community_needs( community_owner, users, logged_client, - community_with_workflow_factory, community_inclusion_service, draft_with_community_factory, record_service, @@ -256,7 +232,6 @@ def test_record_owners_in_default_record_community_needs( community_owner, users, logged_client, - community_with_workflow_factory, community_inclusion_service, draft_with_community_factory, record_service, @@ -266,7 +241,6 @@ def test_record_owners_in_default_record_community_needs( community_owner, users, logged_client, - community_with_workflow_factory, community_inclusion_service, draft_with_community_factory, record_service,