Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Krist committed Jan 28, 2025
1 parent 4f34ab1 commit 3e8f872
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion oarepo_communities/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from functools import cached_property
from typing import TYPE_CHECKING

from flask_principal import identity_loaded
from deepmerge import always_merger
from flask_principal import identity_loaded

import oarepo_communities.cli # noqa - imported to register CLI commands

Expand Down
10 changes: 8 additions & 2 deletions tests/test_communities/test_community_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,14 @@ def test_search(
ThesisRecord.index.refresh()
ThesisDraft.index.refresh()

response_record1 = owner_client.get(f"/communities/{community_1.id}/records", query_string={"record_status": "published"})
response_record2 = owner_client.get(f"/communities/{community_2.id}/records", query_string={"record_status": "published"})
response_record1 = owner_client.get(
f"/communities/{community_1.id}/records",
query_string={"record_status": "published"},
)
response_record2 = owner_client.get(
f"/communities/{community_2.id}/records",
query_string={"record_status": "published"},
)

response_draft1 = owner_client.get(f"/communities/{community_1.id}/user/records")
response_draft2 = owner_client.get(f"/communities/{community_2.id}/user/records")
Expand Down
8 changes: 2 additions & 6 deletions tests/test_communities/test_community_role_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,8 @@ def test_expand_community_role(
reader_client = logged_client(reader)
owner_client = logged_client(community_owner)

record_id = draft_with_community_factory(
reader.identity, community.id
)["id"]
submit = submit_request_on_draft(
reader.identity, record_id, "publish_draft"
)
record_id = draft_with_community_factory(reader.identity, community.id)["id"]
submit = submit_request_on_draft(reader.identity, record_id, "publish_draft")

read = owner_client.get(link2testclient(submit["links"]["self"]))
read_expanded = owner_client.get(
Expand Down
11 changes: 6 additions & 5 deletions tests/test_communities/test_notifications.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pytest_oarepo.communities.functions import invite


def test_publish_notification_community_role(
app,
community,
Expand All @@ -9,7 +10,7 @@ def test_publish_notification_community_role(
draft_with_community_factory,
submit_request_on_draft,
link2testclient,
search_clear
search_clear,
):
"""Test notification being built on review submit."""

Expand All @@ -21,11 +22,11 @@ def test_publish_notification_community_role(
invite(users[2], str(community.id), "curator")
creator = users[0]

draft1 = draft_with_community_factory(creator.identity, str(community.id), custom_workflow="curator_publish")
draft1 = draft_with_community_factory(
creator.identity, str(community.id), custom_workflow="curator_publish"
)
with mail.record_messages() as outbox:
submit_request_on_draft(
creator.identity, draft1["id"], "publish_draft"
)
submit_request_on_draft(creator.identity, draft1["id"], "publish_draft")
# check notification is build on submit
assert len(outbox) == 2 # both curators should get a mail
recipients = outbox[0].send_to | outbox[1].send_to
Expand Down

0 comments on commit 3e8f872

Please sign in to comment.