-
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 #15 from oarepo/krist/be-264-refresh-requests-inde…
…x-after-create-and-update Krist/be 264 refresh requests index after create and update
- Loading branch information
Showing
17 changed files
with
126 additions
and
81 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
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
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 |
---|---|---|
|
@@ -140,4 +140,3 @@ def stringify_first_val(dct): | |
for k, v in dct.items(): | ||
dct[k] = str(v) | ||
return dct | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[metadata] | ||
name = oarepo-requests | ||
version = 1.1.11 | ||
version = 1.1.12 | ||
description = | ||
authors = Ronald Krist <[email protected]> | ||
readme = README.md | ||
|
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
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,43 @@ | ||
from tests.test_requests.utils import link_api2testclient | ||
|
||
|
||
def test_search( | ||
logged_client_request, | ||
identity_simple, | ||
users, | ||
urls, | ||
publish_request_data_function, | ||
search_clear, | ||
): | ||
creator = users[0] | ||
|
||
draft1 = logged_client_request(creator, "post", urls["BASE_URL"], json={}) | ||
|
||
resp_request_create = logged_client_request( | ||
creator, | ||
"post", | ||
urls["BASE_URL_REQUESTS"], | ||
json=publish_request_data_function(draft1.json["id"]), | ||
) | ||
# should work without refreshing requests index | ||
requests_search = logged_client_request( | ||
creator, "get", urls["BASE_URL_REQUESTS"] | ||
).json | ||
|
||
assert len(requests_search["hits"]["hits"]) == 1 | ||
|
||
link = link_api2testclient(requests_search["hits"]["hits"][0]["links"]["self"]) | ||
extended_link = link.replace("/requests/", "/requests/extended/") | ||
|
||
update = logged_client_request( | ||
creator, | ||
"put", | ||
extended_link, | ||
json={"title": "tralala"}, | ||
) | ||
|
||
requests_search = logged_client_request( | ||
creator, "get", urls["BASE_URL_REQUESTS"] | ||
).json | ||
|
||
assert requests_search["hits"]["hits"][0]["title"] == "tralala" |
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