-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from oarepo/miroslavsimek/be-579-invitation-re…
…quest-fails-on-npe bug: NPE in requests without recipients
- Loading branch information
Showing
3 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# | ||
# Copyright (C) 2024 CESNET z.s.p.o. | ||
# | ||
# oarepo-requests is free software; you can redistribute it and/or | ||
# modify it under the terms of the MIT License; see LICENSE file for more | ||
# details. | ||
# | ||
def test_no_recipient( | ||
logged_client, | ||
users, | ||
urls, | ||
create_draft_via_resource, | ||
search_clear, | ||
): | ||
creator = users[0] | ||
assert creator.id == '1' | ||
|
||
creator_client = logged_client(creator) | ||
|
||
draft1 = create_draft_via_resource(creator_client, custom_workflow="with_ct") | ||
|
||
resp_request_create = creator_client.post( | ||
urls["BASE_URL_REQUESTS"], | ||
json={ | ||
"request_type": "approve_draft", | ||
"topic": {"thesis_draft": draft1.json["id"]}, | ||
} | ||
) | ||
assert resp_request_create.status_code == 201 | ||
assert resp_request_create.json['receiver'] is None | ||
assert resp_request_create.json['links']['receiver'] == {} |