Skip to content

Commit

Permalink
Add test to check minimal citation when journal name not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
jonavellecuerdo committed May 9, 2024
1 parent 0ba812f commit 135a344
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions solenoid/records/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,24 @@ def test_create_citation_case_8(self):
"</a>",
)

def test_create_citation_case_9(self):
"""Minimal citation:
journal: NO
publication date: YES
volume & issue: YES
doi: YES
"""
data = copy.copy(self.citation_data)
data.update(dict.fromkeys([Fields.JOURNAL], None))
citation = Record.create_citation(data)
self.assertEqual(
citation,
"Wilczek, F. (1973). Ultraviolet behavior of "
"non-abelian gauge theories. <JOURNAL-NAME UNIDENTIFIED>, "
'30(26). <a href="https://doi.org/10.1103/PhysRevLett.30.1343">'
"doi:10.1103/PhysRevLett.30.1343</a>",
)

def test_create_citation_error_case_1(self):
"""Minimal citation; has volume, lacks issue."""
data = copy.copy(self.citation_data)
Expand Down

0 comments on commit 135a344

Please sign in to comment.