Commit b5d7b17b authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Restore pytest.

parent 505cce24
......@@ -586,7 +586,7 @@ class CheckAndFix(object):
db = self.db
is_cppm = db(db.affiliation_keys.key_u.contains("CPPM")).count() > 0
is_cppm = self._get_reg_institute().find("CPPM") != -1
# CPPM: fix the name of Aix-Marseille university
if is_cppm:
......
......@@ -59,8 +59,10 @@ def recordfix(record):
def test_find_authors_by_affiliation(recordfix):
rex = current.app.reg_institute
assert rex == "Marseille, CPPM|CPPM, Marseille|Centre de Physique des Particules de Marseille (CPPM)"
svc = CheckAndFix()
rex = svc._get_reg_institute()
assert rex == "^CPPM, Marseille|^Centre de Physique des Particules de Marseille (CPPM)|^Marseille, CPPM"
authors = recordfix.find_authors_by_affiliation(rex, family_name_fr)
assert authors.split(', ') == CPPM_AUTHORS
......
......@@ -37,7 +37,7 @@ def recordfix(record):
svc = CheckAndFix()
svc.authors(rec)
svc.country(rec)
svc.conference_date(rec)
svc.conference_date(rec, "cds.cern.ch")
svc.format_authors(rec, format_author_fr)
svc.format_editor(rec)
svc.get_my_authors(rec, family_name_fr)
......
......@@ -42,7 +42,7 @@ def recordfix(record):
svc = CheckAndFix()
svc.authors(rec)
svc.country(rec)
svc.conference_date(rec)
svc.conference_date(rec, "inspirehep.net")
svc.format_authors(rec, format_author_fr)
svc.format_editor(rec)
svc.submitted(rec)
......
......@@ -16,6 +16,6 @@ def test_protection_format_authors():
authors = record[u"700"]
assert len(authors) == 139
assert authors[128]["a"] == u"J. Zuniga"
assert authors[128]["a"] == u"J. Zúñiga"
......@@ -32,7 +32,7 @@ def recordfix(record):
svc = CheckAndFix()
svc.authors(rec)
svc.country(rec)
svc.conference_date(rec)
svc.conference_date(rec, "cds.cern.ch")
svc.format_authors(rec, format_author_fr)
svc.format_editor(rec)
svc.submitted(rec)
......
......@@ -16,9 +16,12 @@ from invenio_tools import load_record
def test_these_universities():
record = load_record('cds.cern.ch', 2015250)
current.app.inspirehep_institute_id = 9999
svc = CheckAndFix()
svc._get_reg_institute()
current.app.reg_institute = "dumy value"
svc.format_universities(record)
assert record.these_universities() == [u"Milan Bicocca Université"]
......@@ -13,7 +13,7 @@ def test_protection_authors_as_list():
record = load_record('inspirehep.net', 1386663)
authors = record.authors_as_list()
assert len(authors) == 140
assert authors[129] == u"Zuniga, J."
assert authors[129] == u"Zúñiga, J."
def test_protection_find_authors_by_affiliation():
......
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