services: Add locale to search params via args #1626
Annotations
6 errors
Tests / Tests (3.9, postgresql14, opensearch2):
tests/resources/test_resource_sorting.py#L1
Black format check
--- /home/runner/work/invenio-records-resources/invenio-records-resources/tests/resources/test_resource_sorting.py 2024-08-14 14:14:16.415075+00:00
+++ /home/runner/work/invenio-records-resources/invenio-records-resources/tests/resources/test_resource_sorting.py 2024-08-14 14:15:58.364184+00:00
@@ -100,23 +100,31 @@
def test_sort_in_links_no_matter_if_sort_in_url(client, headers, three_indexed_records):
response = client.get("/mocks?size=1&sort=newest", headers=headers)
response_links = response.json["links"]
expected_links = {
- "self": ("https://127.0.0.1:5000/api/mocks?locale=en&page=1&size=1&sort=newest"),
- "next": ("https://127.0.0.1:5000/api/mocks?locale=en&page=2&size=1&sort=newest"),
+ "self": (
+ "https://127.0.0.1:5000/api/mocks?locale=en&page=1&size=1&sort=newest"
+ ),
+ "next": (
+ "https://127.0.0.1:5000/api/mocks?locale=en&page=2&size=1&sort=newest"
+ ),
}
# NOTE: This is done so that we only test for pagination links
for key, url in expected_links.items():
assert url == response_links[key]
response = client.get("/mocks?size=1", headers=headers)
response_links = response.json["links"]
expected_links = {
- "self": ("https://127.0.0.1:5000/api/mocks?locale=en&page=1&size=1&sort=newest"),
- "next": ("https://127.0.0.1:5000/api/mocks?locale=en&page=2&size=1&sort=newest"),
+ "self": (
+ "https://127.0.0.1:5000/api/mocks?locale=en&page=1&size=1&sort=newest"
+ ),
+ "next": (
+ "https://127.0.0.1:5000/api/mocks?locale=en&page=2&size=1&sort=newest"
+ ),
}
for key, url in expected_links.items():
assert url == response_links[key]
|
Tests / Tests (3.9, postgresql14, opensearch2):
invenio_records_resources/resources/records/args.py#L1
isort-check
"""Schemas for parameter parsing."""
+from flask_resources.parsers import MultiDictSchema
from invenio_i18n import get_locale
-
-from flask_resources.parsers import MultiDictSchema
from marshmallow import fields, post_load, validate
|
Tests / Tests (3.9, postgresql14, opensearch2)
Process completed with exit code 1.
|
Tests / Tests (3.12, postgresql14, opensearch2):
tests/resources/test_resource_sorting.py#L1
Black format check
--- /home/runner/work/invenio-records-resources/invenio-records-resources/tests/resources/test_resource_sorting.py 2024-08-14 14:14:15.733026+00:00
+++ /home/runner/work/invenio-records-resources/invenio-records-resources/tests/resources/test_resource_sorting.py 2024-08-14 14:16:10.753495+00:00
@@ -100,23 +100,31 @@
def test_sort_in_links_no_matter_if_sort_in_url(client, headers, three_indexed_records):
response = client.get("/mocks?size=1&sort=newest", headers=headers)
response_links = response.json["links"]
expected_links = {
- "self": ("https://127.0.0.1:5000/api/mocks?locale=en&page=1&size=1&sort=newest"),
- "next": ("https://127.0.0.1:5000/api/mocks?locale=en&page=2&size=1&sort=newest"),
+ "self": (
+ "https://127.0.0.1:5000/api/mocks?locale=en&page=1&size=1&sort=newest"
+ ),
+ "next": (
+ "https://127.0.0.1:5000/api/mocks?locale=en&page=2&size=1&sort=newest"
+ ),
}
# NOTE: This is done so that we only test for pagination links
for key, url in expected_links.items():
assert url == response_links[key]
response = client.get("/mocks?size=1", headers=headers)
response_links = response.json["links"]
expected_links = {
- "self": ("https://127.0.0.1:5000/api/mocks?locale=en&page=1&size=1&sort=newest"),
- "next": ("https://127.0.0.1:5000/api/mocks?locale=en&page=2&size=1&sort=newest"),
+ "self": (
+ "https://127.0.0.1:5000/api/mocks?locale=en&page=1&size=1&sort=newest"
+ ),
+ "next": (
+ "https://127.0.0.1:5000/api/mocks?locale=en&page=2&size=1&sort=newest"
+ ),
}
for key, url in expected_links.items():
assert url == response_links[key]
|
Tests / Tests (3.12, postgresql14, opensearch2):
invenio_records_resources/resources/records/args.py#L1
isort-check
"""Schemas for parameter parsing."""
+from flask_resources.parsers import MultiDictSchema
from invenio_i18n import get_locale
-
-from flask_resources.parsers import MultiDictSchema
from marshmallow import fields, post_load, validate
|
Tests / Tests (3.12, postgresql14, opensearch2)
Process completed with exit code 1.
|