chore: Make newer bibtexparser versions work with the tests (#4205)
* chore: Make newer bibtexparser versions work with the tests * Fix test
This commit is contained in:
parent
57818a0131
commit
495df36a77
|
@ -1828,7 +1828,7 @@ class DocTestCase(TestCase):
|
|||
self.assertNotContains(r, "Request publication")
|
||||
|
||||
def _parse_bibtex_response(self, response) -> dict:
|
||||
parser = bibtexparser.bparser.BibTexParser()
|
||||
parser = bibtexparser.bparser.BibTexParser(common_strings=True)
|
||||
parser.homogenise_fields = False # do not modify field names (e.g., turns "url" into "link" by default)
|
||||
return bibtexparser.loads(response.content.decode(), parser=parser).get_entry_dict()
|
||||
|
||||
|
@ -1850,7 +1850,7 @@ class DocTestCase(TestCase):
|
|||
self.assertEqual(entry['number'], num)
|
||||
self.assertEqual(entry['doi'], '10.17487/RFC%s'%num)
|
||||
self.assertEqual(entry['year'], '2010')
|
||||
self.assertEqual(entry['month'], 'oct')
|
||||
self.assertEqual(entry['month'].lower()[0:3], 'oct')
|
||||
self.assertEqual(entry['url'], f'https://www.rfc-editor.ietf.org/info/rfc{num}')
|
||||
#
|
||||
self.assertNotIn('day', entry)
|
||||
|
@ -1872,7 +1872,7 @@ class DocTestCase(TestCase):
|
|||
self.assertEqual(entry['number'], num)
|
||||
self.assertEqual(entry['doi'], '10.17487/RFC%s'%num)
|
||||
self.assertEqual(entry['year'], '1990')
|
||||
self.assertEqual(entry['month'], 'apr')
|
||||
self.assertEqual(entry['month'].lower()[0:3], 'apr')
|
||||
self.assertEqual(entry['day'], '1')
|
||||
self.assertEqual(entry['url'], f'https://www.rfc-editor.ietf.org/info/rfc{num}')
|
||||
|
||||
|
@ -1885,7 +1885,7 @@ class DocTestCase(TestCase):
|
|||
self.assertEqual(entry['note'], 'Work in Progress')
|
||||
self.assertEqual(entry['number'], docname)
|
||||
self.assertEqual(entry['year'], str(draft.pub_date().year))
|
||||
self.assertEqual(entry['month'], draft.pub_date().strftime('%b').lower())
|
||||
self.assertEqual(entry['month'].lower()[0:3], draft.pub_date().strftime('%b').lower())
|
||||
self.assertEqual(entry['day'], str(draft.pub_date().day))
|
||||
self.assertEqual(entry['url'], settings.IDTRACKER_BASE_URL + urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=draft.name, rev=draft.rev)))
|
||||
#
|
||||
|
|
|
@ -3,7 +3,7 @@ setuptools>=51.1.0 # Require this first, to prevent later errors
|
|||
#
|
||||
argon2-cffi>=21.3.0 # For the Argon2 password hasher option
|
||||
beautifulsoup4>=4.11.1 # Only used in tests
|
||||
bibtexparser>=0.6.2,<1.0 # Only used in tests. Version 1.0 doesn't work under python 2.7. 1.0.1 doesn't recognize month names or abbreviations.
|
||||
bibtexparser>=1.2.0 # Only used in tests
|
||||
bleach>=5.0.0
|
||||
coverage>=4.5.4,<5.0 # Coverage 5.x moves from a json database to SQLite. Moving to 5.x will require substantial rewrites in ietf.utils.test_runner and ietf.release.views
|
||||
decorator>=5.1.1
|
||||
|
|
Loading…
Reference in a new issue