Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mesemus committed Dec 6, 2024
1 parent aeb4674 commit 06201a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion oarepo_requests/services/oarepo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ def __init__(self, entity: str, when: callable = None):
def expand(self, obj: Request, context: dict) -> dict:
"""Create the request links."""
res = {}
res.update(self._resolve(obj, context)["links"])
resolved = self._resolve(obj, context)
if "links" in resolved:
res.update(resolved["links"])

if hasattr(obj.type, "extra_entity_links"):
entity = self._resolve(obj, context)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_requests/test_no_recipient.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_no_recipient(
search_clear,
):
creator = users[0]
assert creator.id == 1
assert creator.id == '1'

creator_client = logged_client(creator)

Expand All @@ -26,6 +26,6 @@ def test_no_recipient(
"topic": {"thesis_draft": draft1.json["id"]},
}
)
print(resp_request_create.json)
assert resp_request_create.status_code == 201
assert resp_request_create.json == {}
assert resp_request_create.json['receiver'] is None
assert resp_request_create.json['links']['receiver'] == {}

0 comments on commit 06201a0

Please sign in to comment.