dump-things-service/dump_things_service/tests/test_unicode.py
Michael Hanke c332abbd1b
Some checks failed
Codespell / Check for spelling errors (push) Successful in 42s
Codespell / Check for spelling errors (pull_request) Successful in 43s
Ruff / Code linting (push) Failing after 52s
Ruff / Code linting (pull_request) Failing after 54s
Test execution / Test-all (push) Successful in 1m27s
Type annotation (PR) / check (pull_request) Failing after 1m30s
chore: auto-apply code formatting fixes via hatch check fmt --fix
2026-06-30 20:41:05 +02:00

38 lines
1 KiB
Python

from pathlib import Path
from .. import HTTP_200_OK
# Path to a local simple test schema
schema_file = Path(__file__).parent / 'testschema.yaml'
extra_record = {
'schema_type': 'abc:Person',
'pid': 'abc:aaaa',
'given_name': 'DavidÖÄÜ',
}
delete_record = {
'schema_type': 'abc:Person',
'pid': 'abc:delete-me',
'given_name': 'Detlef',
}
unicode_name = 'AlienÖÄÜ-ß👽'
unicode_bytes = unicode_name.encode('utf-8')
unicode_record = {
'schema_type': 'abc:Person',
'pid': 'abc:unicode-test',
'given_name': unicode_name,
}
def test_unicode_iri(fastapi_client_simple):
test_client, _, _ = fastapi_client_simple
response = test_client.post(
'/collection_1/record/Person',
headers={'x-dumpthings-token': 'token-1'},
json={
'pid': 'https://en.wikipedia.org/wiki/Universita_degli_Studi_eCampus',
'given_name': 'Università degli Studi eCampus (Italy)', # codespell:ignore
},
)
assert response.status_code == HTTP_200_OK