Commit 98a1af1f authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update checkAndFix.temporary_record

parent 1a93c0f4
......@@ -76,6 +76,7 @@ REG_WELL_FORMED_CONF_DATES_2 = \
re.compile("\d{1,2} [A-Z][a-z]{2} - \d{1,2} [A-Z][a-z]{2} \d{4}")
T6 = " "*6
TMP_REC = "*Temporary record*"
UNIVERSITY = "University"
......@@ -1004,9 +1005,14 @@ class CheckAndFix(object):
# Can be find by using the XML syntax:
# http://inspirehep.net/search?500__a="*Temporary record*"
#
# or the corresponding JSON field:
# or the corresponding JSON field (old.inspirehep.net)
# http://inspirehep.net/comment="*Temporary record*"
#
if "comment" in record:
if record["comment"] == "*Temporary record*":
raise CheckException(MSG_TEMPORARY_RECORD)
# for the new inspirehep API curated is False
#
is_temporary = \
("comment" in record and record["comment"] == TMP_REC) \
or ("curated" in record and record["curated"] is False)
if is_temporary:
raise CheckException(MSG_TEMPORARY_RECORD)
......@@ -67,7 +67,7 @@ def test_temporary_record_cds_11012(svc, reccds):
# try with the oldest one to avoid issue with missing information, etc.
with pytest.raises(CheckException):
recins = load_record("inspirehep.net", li[-1])
recins = load_record("inspirehep.net", li[-1], shelf="literature")
svc.temporary_record(recins)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment