From f9ca1bc9d615ce8003fc663061ce303c94c3475b Mon Sep 17 00:00:00 2001 From: Jennifer Richards <jennifer@staff.ietf.org> Date: Mon, 14 Aug 2023 12:15:09 -0300 Subject: [PATCH] test: Test behavior of verified-errata tag Also add comments flagging the near-miss between doc-id and RFC number in the test_rfc_index() test data. It's unclear whether these were intended to match, but the test was self-consistent so I am not changing it. --- ietf/sync/tests.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ietf/sync/tests.py b/ietf/sync/tests.py index 2706c7057..e1ea1522e 100644 --- a/ietf/sync/tests.py +++ b/ietf/sync/tests.py @@ -307,7 +307,7 @@ class RFCSyncTests(TestCase): errata = [{ "errata_id":1, - "doc-id":"RFC123", + "doc-id":"RFC123", # n.b. this is not the same RFC as in the above index XML! "errata_status_code":"Verified", "errata_type_code":"Editorial", "section": "4.1", @@ -375,7 +375,11 @@ class RFCSyncTests(TestCase): self.assertEqual(rfc_events[1].type, "published_rfc") self.assertEqual(rfc_events[1].time.astimezone(RPC_TZINFO).date(), today) self.assertEqual(rfc_doc.get_state_slug(), "published") - self.assertTrue("errata" in rfc_doc.tags.all().values_list("slug", flat=True)) + # Should have an "errata" tag because there is an errata-url in the index XML, but no "verified-errata" tag + # because there is no verified item in the errata JSON with doc-id matching the RFC document. + tag_slugs = rfc_doc.tags.values_list("slug", flat=True) + self.assertTrue("errata" in tag_slugs) + self.assertFalse("verified-errata" in tag_slugs) self.assertTrue(DocAlias.objects.filter(name="rfc1234", docs=rfc_doc)) self.assertTrue(DocAlias.objects.filter(name="bcp1", docs=rfc_doc)) self.assertTrue(DocAlias.objects.filter(name="fyi1", docs=rfc_doc))