def test_import_finto(finto):
importer = FintoImporter(
model=FieldOfScience,
source="https://finto-mock/field_of_science.ttl",
)
importer.load()
values = sorted(
FieldOfScience.all_objects.values(
"pref_label__en",
"url",
"in_scheme",
"broader__pref_label__en",
),
key=lambda v: v["url"],
)
assert values == [
{
"pref_label__en": "Mathematics",
"url": "http://www.yso.fi/onto/okm-tieteenala/ta111",
"in_scheme": "http://www.yso.fi/onto/okm-tieteenala/conceptscheme",
"broader__pref_label__en": None,
},
{
"pref_label__en": "Statistics and probability",
"url": "http://www.yso.fi/onto/okm-tieteenala/ta112",
"in_scheme": "http://www.yso.fi/onto/okm-tieteenala/conceptscheme",
"broader__pref_label__en": None,
},
{
"pref_label__en": "Computer and information sciences",
"url": "http://www.yso.fi/onto/okm-tieteenala/ta113",
"in_scheme": "http://www.yso.fi/onto/okm-tieteenala/conceptscheme",
"broader__pref_label__en": None,
},
{
"pref_label__en": "Physical sciences",
"url": "http://www.yso.fi/onto/okm-tieteenala/ta114",
"in_scheme": "http://www.yso.fi/onto/okm-tieteenala/conceptscheme",
"broader__pref_label__en": None,
},
{
"pref_label__en": "Astronomy, Space science",
"url": "http://www.yso.fi/onto/okm-tieteenala/ta115",
"in_scheme": "http://www.yso.fi/onto/okm-tieteenala/conceptscheme",
"broader__pref_label__en": None,
},
{
"pref_label__en": "Chemical sciences",
"url": "http://www.yso.fi/onto/okm-tieteenala/ta116",
"in_scheme": "http://www.yso.fi/onto/okm-tieteenala/conceptscheme",
"broader__pref_label__en": None,
},
]