def test_article_preprint(self): """test for an article with preprint data""" doi = "10.7554/eLife.00666" article = Article(doi, title="Sample article") article.preprint = Preprint(uri="https://example.org/") expected_contains = ( "<rel:program>" "<rel:related_item>" '<rel:intra_work_relation identifier-type="uri"' ' relationship-type="hasPreprint">https://example.org/' "</rel:intra_work_relation>" "</rel:related_item>" "</rel:program>") # generate crossref_object = generate.build_crossref_xml([article]) crossref_xml_string = crossref_object.output_xml() # test assertion self.assertTrue(expected_contains in crossref_xml_string)
def test_do_relations_program_preprint(self): article = Article("10.7554/eLife.00666") article.preprint = Preprint(uri="https://example.org") do_result = related.do_relations_program(article) self.assertTrue(do_result)
def test_do_preprint_related_item(self): article = Article() article.preprint = Preprint(uri="https://example.org") do_result = related.do_preprint_related_item(article) self.assertTrue(do_result)