dump-things-server/dump_things_service/tests/test_pid_resolution.py
Christian Monch 09be6912a0 return admin_token in test fixture
The test-fixture `fast_api_simple` now
returns a tuple containing:

- test_client instance
- store path
- admin token
2026-06-10 16:02:14 +02:00

17 lines
616 B
Python

import pytest
from .. import HTTP_422_UNPROCESSABLE_CONTENT
@pytest.mark.parametrize('pid', ['unknown_prefix:test_pid', 'abc:test_öö_pid'])
@pytest.mark.parametrize('url_part', ['', 'curated/', 'incoming/in_token_1/'])
def test_store_record_validation(fastapi_client_simple, pid, url_part):
test_client, _, _ = fastapi_client_simple
# Store a record in two collections
response = test_client.post(
f'/collection_1/{url_part}record/Person',
headers={'x-dumpthings-token': 'token-1'},
json={'pid': pid},
)
assert response.status_code == HTTP_422_UNPROCESSABLE_CONTENT