From b3128842c966415e6e9b6204dfc77994739a2e1b Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Fri, 28 Aug 2020 13:29:15 +0000 Subject: [PATCH] Renamed the AUTH48 state_alert_badge() filter to auth48_alert_badge(), as the filter is specific, not generic. - Legacy-Id: 18439 --- ietf/doc/templatetags/ballot_icon.py | 2 +- ietf/doc/templatetags/tests_ballot_icon.py | 14 +++++++------- ietf/doc/tests.py | 2 +- ietf/templates/doc/search/status_columns.html | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ietf/doc/templatetags/ballot_icon.py b/ietf/doc/templatetags/ballot_icon.py index 1a6bedd02..2c3d6bcb2 100644 --- a/ietf/doc/templatetags/ballot_icon.py +++ b/ietf/doc/templatetags/ballot_icon.py @@ -220,7 +220,7 @@ def state_age_colored(doc): return "" @register.filter -def state_alert_badge(doc): +def auth48_alert_badge(doc): """Return alert badge, if any, for a document""" if doc.type_id != 'draft': return '' diff --git a/ietf/doc/templatetags/tests_ballot_icon.py b/ietf/doc/templatetags/tests_ballot_icon.py index 973014143..fa0ee3eed 100644 --- a/ietf/doc/templatetags/tests_ballot_icon.py +++ b/ietf/doc/templatetags/tests_ballot_icon.py @@ -1,20 +1,20 @@ from ietf.doc.factories import WgDraftFactory -from ietf.doc.templatetags.ballot_icon import state_alert_badge +from ietf.doc.templatetags.ballot_icon import auth48_alert_badge from ietf.utils.test_utils import TestCase class BallotIconTests(TestCase): - def test_state_alert_badge_marks_auth48(self): + def test_auth48_alert_badge_marks_auth48(self): draft = WgDraftFactory(states=[ ('draft','active'), ('draft-iesg','rfcqueue'), ('draft-rfceditor', 'auth48'), ]) - output = state_alert_badge(draft) + output = auth48_alert_badge(draft) self.assertIn('AUTH48', output) - def test_state_alert_badge_ignores_others(self): - # If the state_alert_badge() method becomes more complicated, more + def test_auth48_alert_badge_ignores_others(self): + # If the auth48_alert_badge() method becomes more complicated, more # sophisticated testing can be added. # For now, just test a couple states that should not be marked. draft = WgDraftFactory(states=[ @@ -22,7 +22,7 @@ class BallotIconTests(TestCase): ('draft-iesg', 'approved'), # not in rfcqueue state ('draft-rfceditor', 'auth48'), ]) - output = state_alert_badge(draft) + output = auth48_alert_badge(draft) self.assertEqual('', output) draft = WgDraftFactory(states=[ @@ -30,5 +30,5 @@ class BallotIconTests(TestCase): ('draft-iesg', 'rfcqueue'), ('draft-rfceditor', 'auth48-done'), # not in auth48 state ]) - output = state_alert_badge(draft) + output = auth48_alert_badge(draft) self.assertEqual('', output) diff --git a/ietf/doc/tests.py b/ietf/doc/tests.py index 288fac75f..82f2cbfd7 100644 --- a/ietf/doc/tests.py +++ b/ietf/doc/tests.py @@ -261,7 +261,7 @@ class SearchTests(TestCase): kwargs=dict(name=ad.full_name_as_key()))) self.assertEqual(r.status_code, 200) self.assertContains(r, draft.name) - self.assertContains(r, 'title="AUTH48"') # title attribute of AUTH48 badge in state_alert_badge filter + self.assertContains(r, 'title="AUTH48"') # title attribute of AUTH48 badge in auth48_alert_badge filter def test_drafts_in_last_call(self): draft = IndividualDraftFactory(pages=1) diff --git a/ietf/templates/doc/search/status_columns.html b/ietf/templates/doc/search/status_columns.html index b86161d0f..698a703aa 100644 --- a/ietf/templates/doc/search/status_columns.html +++ b/ietf/templates/doc/search/status_columns.html @@ -17,7 +17,7 @@ : {{ doc|state:"draft-rfceditor" }} {% endif %} - {{ doc|state_alert_badge }} + {{ doc|auth48_alert_badge }} {{ doc|state_age_colored }}