本文整理汇总了Python中papers.models.Paper.create_by_oai_id方法的典型用法代码示例。如果您正苦于以下问题:Python Paper.create_by_oai_id方法的具体用法?Python Paper.create_by_oai_id怎么用?Python Paper.create_by_oai_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类papers.models.Paper
的用法示例。
在下文中一共展示了Paper.create_by_oai_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_try_deposit_paper_already_on_zenodo
# 需要导入模块: from papers.models import Paper [as 别名]
# 或者: from papers.models.Paper import create_by_oai_id [as 别名]
def test_try_deposit_paper_already_on_zenodo(self, mock_makeRequest):
"""
If the paper is already known to be on Zenodo by Dissemin,
``init_deposit`` should return ``False`` to prevent any new deposit.
"""
oaisource = OaiSource.objects.get(identifier='zenodo')
oaisource.endpoint = 'http://example.com/' # not actually used as we are mocking the HTTP call
oaisource.save()
mock_makeRequest.return_value = self.zenodo_record
p = Paper.create_by_oai_id('oai:pubmedcentral.nih.gov:4131942', source=oaisource)
enabled = self.proto.init_deposit(p, self.user)
self.assertFalse(enabled)