def test_external_identifiers(api_client, db, es, create_record, datadir): data = json.loads((datadir / "1375491.json").read_text()) record = create_record("lit", data=data) response = api_client.get("/literature/1375491") assert response.status_code == 200 inbook = json.loads(response.data) converter = OrcidConverter( inbook["metadata"], url_pattern="http://inspirehep.net/record/{recid}") converter.get_xml() expected = [ ExternalIdentifier(type="other-id", value="1375491"), ExternalIdentifier(type="doi", value=u"10.1007/978-3-319-15001-7_10"), ExternalIdentifier(type="arxiv", value=u"1506.03091"), ] assert converter.added_external_identifiers == expected
def test_bibtext_do_not_add_bibtex_citation(inspire_app, datadir): data = orjson.loads( (datadir / "test_orcid_converter_TestBibtexCitation.json").read_text() ) record = create_record("lit", data=data) converter = OrcidConverter( record=record, url_pattern="http://inspirehep.net/record/{recid}" ) xml_root = converter.get_xml() top_level_tags = [etree.QName(node).localname for node in xml_root.getchildren()] assert "citation" not in top_level_tags