From 469c67296e3bea81424e448b3154179d23385b76 Mon Sep 17 00:00:00 2001 From: Russ Housley Date: Mon, 8 Mar 2021 13:51:38 +0000 Subject: [PATCH] Provide bibxml test for drafts that end in a hyphen and a digit. - Legacy-Id: 18906 --- ietf/doc/tests.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ietf/doc/tests.py b/ietf/doc/tests.py index 98bc3af89..14c469ad9 100644 --- a/ietf/doc/tests.py +++ b/ietf/doc/tests.py @@ -1231,9 +1231,7 @@ class DocTestCase(TestCase): self.assertEqual(r.status_code, 200) self.assertNotContains(r, "Request publication") - def test_document_bibtex(self): - rfc = WgRfcFactory.create( #other_aliases = ['rfc6020',], states = [('draft','rfc'),('draft-iesg','pub')], @@ -1304,6 +1302,17 @@ class DocTestCase(TestCase): self.assertEqual(entry.find('./seriesInfo').get('value'), docname) self.assertEqual(entry.find('./seriesInfo[@name="DOI"]'), None) + def test_trailing_hypen_digit_name_bibxml(self): + draft = WgDraftFactory(name='draft-ietf-mars-test-2') + docname = '%s-%s' % (draft.name, draft.rev) + for viewname in [ 'ietf.doc.views_doc.document_bibxml', 'ietf.doc.views_doc.document_bibxml_ref' ]: + # This will need to be adjusted if settings.URL_REGEXPS is changed + url = urlreverse(viewname, kwargs=dict(name=draft.name[:-2], rev=draft.name[-1:]+'-'+draft.rev)) + r = self.client.get(url) + entry = lxml.etree.fromstring(r.content) + self.assertEqual(entry.find('./front/title').text, draft.title) + self.assertEqual(entry.find('./seriesInfo').get('value'), docname) + class AddCommentTestCase(TestCase): def test_add_comment(self): draft = WgDraftFactory(name='draft-ietf-mars-test',group__acronym='mars')