39 lines
1,013 B
Python
39 lines
1,013 B
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)',
|
|
}
|
|
)
|
|
assert response.status_code == HTTP_200_OK
|