The test-fixture `fast_api_simple` now returns a tuple containing: - test_client instance - store path - admin token
17 lines
616 B
Python
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
|