diff --git a/osf_tests/metadata/test_osf_gathering.py b/osf_tests/metadata/test_osf_gathering.py index 52289367ccc..7bd72770aba 100644 --- a/osf_tests/metadata/test_osf_gathering.py +++ b/osf_tests/metadata/test_osf_gathering.py @@ -538,6 +538,7 @@ def test_gather_affiliated_institutions(self): institution_iri = URIRef(institution.ror_uri) self.user__admin.add_or_update_affiliated_institution(institution) self.project.add_affiliated_institution(institution, self.user__admin) + self.preprint.add_affiliated_institution(institution, self.user__admin) assert_triples(osf_gathering.gather_affiliated_institutions(self.projectfocus), { (self.projectfocus.iri, OSF.affiliation, institution_iri), (institution_iri, RDF.type, DCTERMS.Agent), @@ -559,6 +560,15 @@ def test_gather_affiliated_institutions(self): assert_triples(osf_gathering.gather_affiliated_institutions(self.registrationfocus), set()) # focus: file assert_triples(osf_gathering.gather_affiliated_institutions(self.filefocus), set()) + # focus: preprint + assert_triples(osf_gathering.gather_affiliated_institutions(self.preprintfocus), { + (self.preprintfocus.iri, OSF.affiliation, institution_iri), + (institution_iri, RDF.type, DCTERMS.Agent), + (institution_iri, RDF.type, FOAF.Organization), + (institution_iri, FOAF.name, Literal(institution.name)), + (institution_iri, DCTERMS.identifier, Literal(institution.identifier_domain)), + (institution_iri, DCTERMS.identifier, Literal(institution.ror_uri)), + }) def test_gather_funding(self): # focus: project