Commit 8c67dc7e authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update PublicationInfoMixin.format_editor to handle ':'

parent e4ed5623
...@@ -84,9 +84,12 @@ class PublicationInfoMixin(object): ...@@ -84,9 +84,12 @@ class PublicationInfoMixin(object):
editor = df.title editor = df.title
volume = df.volume volume = df.volume
# add space after the dot Phys.Rev -> Phys. Rev # add space after the dot RevPhys or Phys.Rev -> Phys. Rev
editor = re.sub(r'\.([A-Z])', r'. \1', editor) editor = re.sub(r'\.([A-Z])', r'. \1', editor)
# remove ":" in editor (see cds.cern.ch/record/1411352
editor = editor.replace(":", "")
# get the volume letter # get the volume letter
m = re.match(r'([A-Z]+) *(\d+)', volume) m = re.match(r'([A-Z]+) *(\d+)', volume)
if m: if m:
......
...@@ -109,15 +109,15 @@ def test_format_editor_15022(record): ...@@ -109,15 +109,15 @@ def test_format_editor_15022(record):
record.format_editor() record.format_editor()
assert record.paper_editor() == "J. Phys.: Conf. Ser." assert record.paper_editor() == "J. Phys. Conf. Ser."
assert record.paper_volume() == "335" assert record.paper_volume() == "335"
def test_check_publisher_15023(record): def test_check_publisher_15023(record):
# raise CheckException in case of problem # raise CheckException in case of problem
with pytest.raises(CheckException): assert record.check_publisher(current.db) is None
record.check_publisher(current.db)
def test_check_paper_reference_15024(record): def test_check_paper_reference_15024(record):
assert record.paper_reference() == "J. Phys.: Conf. Ser. 335 2011 012042" record.format_editor()
assert record.paper_reference() == "J. Phys. Conf. Ser. 335 2011 012042"
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