From 4165235a1609eb58fcdc7a20a1d710bad098ef0a Mon Sep 17 00:00:00 2001 From: Jennifer Richards Date: Fri, 15 May 2026 13:21:54 -0300 Subject: [PATCH 1/2] chore: strip whitespace in test (#10874) --- ietf/sync/tests_rfcindex.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ietf/sync/tests_rfcindex.py b/ietf/sync/tests_rfcindex.py index 74fa9e7616..2b70924db3 100644 --- a/ietf/sync/tests_rfcindex.py +++ b/ietf/sync/tests_rfcindex.py @@ -1,5 +1,6 @@ # Copyright The IETF Trust 2026, All Rights Reserved import json +import re from pathlib import Path from unittest import mock @@ -131,17 +132,20 @@ def test_create_rfc_txt_index(self, mock_save_blob, mock_save_file): "0123 Not Issued.", contents, ) + + # strip whitespace so line breaks don't interfere with the next few tests + stripped_contents = re.sub(r"\s+", " ", mock_save_blob.call_args[0][1]) self.assertIn( f"{self.april_fools_rfc.rfc_number} {self.april_fools_rfc.title}", - contents, + stripped_contents, ) self.assertIn("1 April 2020", contents) # from the April 1 RFC self.assertIn( f"{self.rfc.rfc_number} {self.rfc.title}", - contents, + stripped_contents, ) - self.assertIn("April 2021", contents) # from the non-April 1 RFC - self.assertNotIn("1 April 2021", contents) + self.assertIn("April 2021", stripped_contents) # from the non-April 1 RFC + self.assertNotIn("1 April 2021", stripped_contents) @override_settings(RFCINDEX_INPUT_PATH="input/") @mock.patch("ietf.sync.rfcindex.save_to_filesystem") From e37a2c97c22636c0d69330c49693bb1071b7b922 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Fri, 15 May 2026 11:22:28 -0500 Subject: [PATCH 2/2] fix: stop linking to pdfized txt at the rfc editor site (#10873) * fix: stop linking to pdfized txt at the rfc editor site * test: adjust tests to match --- ietf/doc/feeds.py | 8 -------- ietf/doc/tests.py | 4 ++-- ietf/doc/utils.py | 3 --- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/ietf/doc/feeds.py b/ietf/doc/feeds.py index 0269906fcf..7472b14c18 100644 --- a/ietf/doc/feeds.py +++ b/ietf/doc/feeds.py @@ -234,14 +234,6 @@ def item_extra_kwargs(self, item): "is_format_of": self.item_link(item), } ) - if item.rfc_number not in [571, 587]: - media_contents.append( - { - "url": f"https://www.rfc-editor.org/rfc/pdfrfc/{item.name}.txt.pdf", - "media_type": "application/pdf", - "is_format_of": self.item_link(item), - } - ) else: media_contents.append( { diff --git a/ietf/doc/tests.py b/ietf/doc/tests.py index b001e01e80..ff4461d466 100644 --- a/ietf/doc/tests.py +++ b/ietf/doc/tests.py @@ -2093,9 +2093,9 @@ def test_rfc_feed(self): self.assertEqual(len(q("item")), 3) item = q("item")[0] media_content = item.findall("{http://search.yahoo.com/mrss/}content") - self.assertEqual(len(media_content), 3) + self.assertEqual(len(media_content), 2) types = set([m.attrib["type"] for m in media_content]) - self.assertEqual(types, set(["text/plain", "text/html", "application/pdf"])) + self.assertEqual(types, set(["text/plain", "text/html"])) def test_state_help(self): url = urlreverse('ietf.doc.views_help.state_help', kwargs=dict(type="draft-iesg")) diff --git a/ietf/doc/utils.py b/ietf/doc/utils.py index 6f32ed454f..5f8f587c59 100644 --- a/ietf/doc/utils.py +++ b/ietf/doc/utils.py @@ -1274,9 +1274,6 @@ def build_file_urls(doc: Union[Document, DocHistory]): label = "plain text" if t == "txt" else t file_urls.append((label, base + doc.name + "." + t)) - if "pdf" not in found_types and "txt" in found_types: - file_urls.append(("pdf", base + "pdfrfc/" + doc.name + ".txt.pdf")) - if "txt" in found_types: file_urls.append(("htmlized", urlreverse('ietf.doc.views_doc.document_html', kwargs=dict(name=doc.name)))) if doc.tags.filter(slug="verified-errata").exists():