Colin Watson has proposed merging ~cjwatson/launchpad:dsd-rename-blacklist into launchpad:master.
Commit message: Rename "blacklist" to "blocklist" for DistroSeriesDifferences Requested reviews: Launchpad code reviewers (launchpad-reviewers) For more details, see: https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/438344 Normally we'd need to take a bit more care than this, because renaming HTML fields means that users may have problems if they load a form before the upgrade and attempt to submit it after the upgrade. However, this UI machinery is sufficiently rarely used that I don't think it's worth bothering with anything more careful. -- Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:dsd-rename-blacklist into launchpad:master.
diff --git a/lib/lp/registry/browser/distroseries.py b/lib/lp/registry/browser/distroseries.py index d9ca04f..5782b54 100644 --- a/lib/lp/registry/browser/distroseries.py +++ b/lib/lp/registry/browser/distroseries.py @@ -1258,7 +1258,7 @@ class DistroSeriesDifferenceBaseView( package_type_dsd_status = { NON_IGNORED: DistroSeriesDifferenceStatus.NEEDS_ATTENTION, HIGHER_VERSION_THAN_PARENT: ( - DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT + DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT ), RESOLVED: DistroSeriesDifferenceStatus.RESOLVED, ALL: None, diff --git a/lib/lp/registry/browser/distroseriesdifference.py b/lib/lp/registry/browser/distroseriesdifference.py index 0243d64..795f116 100644 --- a/lib/lp/registry/browser/distroseriesdifference.py +++ b/lib/lp/registry/browser/distroseriesdifference.py @@ -82,18 +82,18 @@ class DistroSeriesDifferenceNavigation(Navigation): class IDistroSeriesDifferenceForm(Interface): """An interface used in the browser only for displaying form elements.""" - blacklist_options = Choice( + blocklist_options = Choice( vocabulary=SimpleVocabulary( ( SimpleTerm("NONE", "NONE", "No"), SimpleTerm( - DistroSeriesDifferenceStatus.BLACKLISTED_ALWAYS, - DistroSeriesDifferenceStatus.BLACKLISTED_ALWAYS.name, + DistroSeriesDifferenceStatus.BLOCKLISTED_ALWAYS, + DistroSeriesDifferenceStatus.BLOCKLISTED_ALWAYS.name, "All versions", ), SimpleTerm( - DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, - DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT.name, + DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, + DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT.name, "These versions", ), ) @@ -104,19 +104,19 @@ class IDistroSeriesDifferenceForm(Interface): @implementer(IConversation) class DistroSeriesDifferenceView(LaunchpadFormView): schema = IDistroSeriesDifferenceForm - custom_widget_blacklist_options = RadioWidget + custom_widget_blocklist_options = RadioWidget @property def initial_values(self): - """Ensure the correct radio button is checked for blacklisting.""" - blacklisted_statuses = ( - DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, - DistroSeriesDifferenceStatus.BLACKLISTED_ALWAYS, + """Ensure the correct radio button is checked for blocklisting.""" + blocklisted_statuses = ( + DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, + DistroSeriesDifferenceStatus.BLOCKLISTED_ALWAYS, ) - if self.context.status in blacklisted_statuses: - return dict(blacklist_options=self.context.status) + if self.context.status in blocklisted_statuses: + return dict(blocklist_options=self.context.status) - return dict(blacklist_options="NONE") + return dict(blocklist_options="NONE") @property def binary_summaries(self): @@ -156,8 +156,8 @@ class DistroSeriesDifferenceView(LaunchpadFormView): return self.request.is_ajax and self.can_request_diffs @cachedproperty - def enable_blacklist_options(self): - """Should we enable the blacklisting (ignore) radio widget options. + def enable_blocklist_options(self): + """Should we enable the blocklisting (ignore) radio widget options. Only enable the options if an editor requests via JS and the user is an archive admin. @@ -167,15 +167,15 @@ class DistroSeriesDifferenceView(LaunchpadFormView): ) @cachedproperty - def blacklist_options_css_class(self): - """The css class for the blacklist option slot. - 'blacklist-options' if enabled. - 'blacklist-options-disabled' if not enabled. + def blocklist_options_css_class(self): + """The css class for the blocklist option slot. + 'blocklist-options' if enabled. + 'blocklist-options-disabled' if not enabled. """ - if self.enable_blacklist_options: - return "blacklist-options" + if self.enable_blocklist_options: + return "blocklist-options" else: - return "blacklist-options-disabled" + return "blocklist-options-disabled" @property def display_diffs(self): diff --git a/lib/lp/registry/browser/tests/test_distroseries.py b/lib/lp/registry/browser/tests/test_distroseries.py index 0e8c409..1a344fa 100644 --- a/lib/lp/registry/browser/tests/test_distroseries.py +++ b/lib/lp/registry/browser/tests/test_distroseries.py @@ -1627,7 +1627,7 @@ class TestDistroSeriesLocalDifferences( return jobs[0] def test_higher_radio_mentions_parent(self): - # The user is shown an option to display only the blacklisted + # The user is shown an option to display only the blocklisted # package with a higher version than in the parent. derived_series, parent_series = self._createChildAndParent() self.factory.makeDistroSeriesDifference( @@ -1700,8 +1700,8 @@ class TestDistroSeriesLocalDifferences( [diff2, diff1], unfiltered_view.cached_differences.batch ) - def test_batch_non_blacklisted(self): - # The default filter is all non blacklisted differences. + def test_batch_non_blocklisted(self): + # The default filter is all non blocklisted differences. derived_series, parent_series = self._createChildAndParent() diff1 = self.factory.makeDistroSeriesDifference( derived_series=derived_series, @@ -1713,7 +1713,7 @@ class TestDistroSeriesLocalDifferences( ) self.factory.makeDistroSeriesDifference( derived_series=derived_series, - status=DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, + status=DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, ) filtered_view = create_initialized_view( @@ -1775,12 +1775,12 @@ class TestDistroSeriesLocalDifferences( derived_series, _ = self._createChildAndParent() blocklisted_diff_higher = self.factory.makeDistroSeriesDifference( derived_series=derived_series, - status=DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, + status=DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, versions={"base": "1.1", "parent": "1.3", "derived": "1.10"}, ) self.factory.makeDistroSeriesDifference( derived_series=derived_series, - status=DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, + status=DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, versions={"base": "1.1", "parent": "1.12", "derived": "1.10"}, ) @@ -2566,11 +2566,11 @@ class DistroSeriesMissingPackageDiffsTestCase(TestCaseWithFactory): derived_series = dsp.derived_series missing_type = DistroSeriesDifferenceType.MISSING_FROM_DERIVED_SERIES - # Missing blacklisted diff. + # Missing blocklisted diff. self.factory.makeDistroSeriesDifference( difference_type=missing_type, derived_series=derived_series, - status=DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, + status=DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, ) missing_diff = self.factory.makeDistroSeriesDifference( @@ -2720,11 +2720,11 @@ class DistroSerieUniquePackageDiffsTestCase( derived_series, parent_series = self._createChildAndParent() missing_type = DistroSeriesDifferenceType.UNIQUE_TO_DERIVED_SERIES - # Missing blacklisted diff. + # Missing blocklisted diff. self.factory.makeDistroSeriesDifference( difference_type=missing_type, derived_series=derived_series, - status=DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, + status=DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, ) missing_diff = self.factory.makeDistroSeriesDifference( diff --git a/lib/lp/registry/browser/tests/test_distroseriesdifference_views.py b/lib/lp/registry/browser/tests/test_distroseriesdifference_views.py index 0ee9a1a..17a8624 100644 --- a/lib/lp/registry/browser/tests/test_distroseriesdifference_views.py +++ b/lib/lp/registry/browser/tests/test_distroseriesdifference_views.py @@ -178,23 +178,23 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): self.assertThat(view(), Not(binary_description_matcher)) def test_show_edit_options_non_ajax(self): - # Blacklist options and "Add comment" are not shown for non-ajax + # Blocklist options and "Add comment" are not shown for non-ajax # requests. ds_diff = self.factory.makeDistroSeriesDifference() - # Without JS, even editors don't see blacklist options. + # Without JS, even editors don't see blocklist options. with person_logged_in(self.factory.makePerson()): view = create_initialized_view( ds_diff, "+listing-distroseries-extra" ) self.assertFalse(view.show_add_comment) - self.assertFalse(view.enable_blacklist_options) + self.assertFalse(view.enable_blocklist_options) self.assertEqual( - "blacklist-options-disabled", view.blacklist_options_css_class + "blocklist-options-disabled", view.blocklist_options_css_class ) def test_show_edit_options_editor(self): - # The "Add comment" link is shown and the blacklist options are + # The "Add comment" link is shown and the blocklist options are # not enabled if requested by an editor via ajax. ds_diff = self.factory.makeDistroSeriesDifference() @@ -204,13 +204,13 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): ds_diff, "+listing-distroseries-extra", request=request ) self.assertTrue(view.show_add_comment) - self.assertFalse(view.enable_blacklist_options) + self.assertFalse(view.enable_blocklist_options) self.assertEqual( - "blacklist-options-disabled", view.blacklist_options_css_class + "blocklist-options-disabled", view.blocklist_options_css_class ) - def test_enable_blacklist_options_for_archive_admin(self): - # To see the blacklist options enabled the user needs to be an + def test_enable_blocklist_options_for_archive_admin(self): + # To see the blocklist options enabled the user needs to be an # archive admin. ds_diff = self.factory.makeDistroSeriesDifference() archive_admin = self.factory.makeArchiveAdmin( @@ -222,7 +222,7 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): view = create_initialized_view( ds_diff, "+listing-distroseries-extra", request=request ) - self.assertTrue(view.enable_blacklist_options) + self.assertTrue(view.enable_blocklist_options) def test_show_add_comment_non_editor(self): # Even with a JS request, non-editors do not see the 'add @@ -610,8 +610,8 @@ class DistroSeriesDifferenceTemplateTestCase(TestCaseWithFactory): view = create_initialized_view(context, view_name, request=request) return view() - def test_blacklist_options(self): - # Blacklist options are presented to the users who are archive + def test_blocklist_options(self): + # Blocklist options are presented to the users who are archive # admins. ds_diff = self.factory.makeDistroSeriesDifference() archive_admin = self.factory.makeArchiveAdmin( @@ -623,11 +623,11 @@ class DistroSeriesDifferenceTemplateTestCase(TestCaseWithFactory): soup = BeautifulSoup(view_content) self.assertEqual( - 1, len(soup.find_all("div", {"class": "blacklist-options"})) + 1, len(soup.find_all("div", {"class": "blocklist-options"})) ) - def test_blacklist_options_disabled(self): - # Blacklist options are disabled to the users who are *not* archive + def test_blocklist_options_disabled(self): + # Blocklist options are disabled to the users who are *not* archive # admins. ds_diff = self.factory.makeDistroSeriesDifference() person = self.factory.makePerson() @@ -638,37 +638,37 @@ class DistroSeriesDifferenceTemplateTestCase(TestCaseWithFactory): self.assertEqual( 1, - len(soup.find_all("div", {"class": "blacklist-options-disabled"})), + len(soup.find_all("div", {"class": "blocklist-options-disabled"})), ) - def test_blacklist_options_initial_values_none(self): + def test_blocklist_options_initial_values_none(self): ds_diff = self.factory.makeDistroSeriesDifference() view = create_initialized_view(ds_diff, "+listing-distroseries-extra") - # If the difference is not currently blacklisted, 'NONE' is set + # If the difference is not currently blocklisted, 'NONE' is set # as the default value for the field. - self.assertEqual("NONE", view.initial_values.get("blacklist_options")) + self.assertEqual("NONE", view.initial_values.get("blocklist_options")) - def test_blacklist_options_initial_values_current(self): + def test_blocklist_options_initial_values_current(self): ds_diff = self.factory.makeDistroSeriesDifference( - status=DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT + status=DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT ) view = create_initialized_view(ds_diff, "+listing-distroseries-extra") self.assertEqual( - DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, - view.initial_values.get("blacklist_options"), + DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, + view.initial_values.get("blocklist_options"), ) - def test_blacklist_options_initial_values_always(self): + def test_blocklist_options_initial_values_always(self): ds_diff = self.factory.makeDistroSeriesDifference( - status=DistroSeriesDifferenceStatus.BLACKLISTED_ALWAYS + status=DistroSeriesDifferenceStatus.BLOCKLISTED_ALWAYS ) view = create_initialized_view(ds_diff, "+listing-distroseries-extra") self.assertEqual( - DistroSeriesDifferenceStatus.BLACKLISTED_ALWAYS, - view.initial_values.get("blacklist_options"), + DistroSeriesDifferenceStatus.BLOCKLISTED_ALWAYS, + view.initial_values.get("blocklist_options"), ) def test_package_diff_request_link(self): diff --git a/lib/lp/registry/browser/tests/test_distroseriesdifference_webservice.py b/lib/lp/registry/browser/tests/test_distroseriesdifference_webservice.py index 877af1a..149fc6f 100644 --- a/lib/lp/registry/browser/tests/test_distroseriesdifference_webservice.py +++ b/lib/lp/registry/browser/tests/test_distroseriesdifference_webservice.py @@ -51,13 +51,13 @@ class DistroSeriesDifferenceWebServiceTestCase(TestCaseWithFactory): ds_diff.parent_series, ) self.assertEqual( - DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, ds_diff.status + DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, ds_diff.status ) def test_unblocklist(self): # The unblocklist method can be called by people with admin access. ds_diff = self.factory.makeDistroSeriesDifference( - status=DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT + status=DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT ) archive_admin = self.factory.makeArchiveAdmin( archive=ds_diff.derived_series.main_archive @@ -195,7 +195,7 @@ class DistroSeriesDifferenceWebServiceTestCase(TestCaseWithFactory): def test_exported_status(self): # The difference's status is exposed. ds_diff = self.factory.makeDistroSeriesDifference( - status=DistroSeriesDifferenceStatus.BLACKLISTED_ALWAYS + status=DistroSeriesDifferenceStatus.BLOCKLISTED_ALWAYS ) ws_diff = ws_object( self.factory.makeLaunchpadService(self.factory.makePerson()), diff --git a/lib/lp/registry/enums.py b/lib/lp/registry/enums.py index 9340d63..bf50514 100644 --- a/lib/lp/registry/enums.py +++ b/lib/lp/registry/enums.py @@ -381,7 +381,7 @@ class DistroSeriesDifferenceStatus(DBEnumeratedType): """, ) - BLACKLISTED_CURRENT = DBItem( + BLOCKLISTED_CURRENT = DBItem( 2, """ Blocklisted current version @@ -391,7 +391,7 @@ class DistroSeriesDifferenceStatus(DBEnumeratedType): """, ) - BLACKLISTED_ALWAYS = DBItem( + BLOCKLISTED_ALWAYS = DBItem( 3, """ Blocklisted always diff --git a/lib/lp/registry/interfaces/distroseriesdifference.py b/lib/lp/registry/interfaces/distroseriesdifference.py index 56eefa8..cfe1d5d 100644 --- a/lib/lp/registry/interfaces/distroseriesdifference.py +++ b/lib/lp/registry/interfaces/distroseriesdifference.py @@ -296,7 +296,7 @@ class IDistroSeriesDifferencePublic(Interface): the same) then the status is updated to RESOLVED. :param manual: Boolean, True if this is a user-requested change. - This overrides auto-blacklisting. + This overrides auto-blocklisting. :return: True if the record was updated, False otherwise. """ @@ -464,5 +464,5 @@ class IDistroSeriesDifferenceSource(Interface): These are `DistroSeriesDifferences` where the parent has been updated and the child still has the old version, unchanged. - Blacklisted items are excluded. + Blocklisted items are excluded. """ diff --git a/lib/lp/registry/javascript/distroseriesdifferences_details.js b/lib/lp/registry/javascript/distroseriesdifferences_details.js index 10b0610..74629a0 100644 --- a/lib/lp/registry/javascript/distroseriesdifferences_details.js +++ b/lib/lp/registry/javascript/distroseriesdifferences_details.js @@ -101,28 +101,28 @@ Y.extend(ExpandableRowWidget, Y.Base, { apiUri: api_uri}); comment_widget.render(add_comment_placeholder); } - // The blacklist slot with a class 'blacklist-options' is only - // available when the user has the right to blacklist. - var blacklist_slot = container.one('div.blacklist-options'); + // The blocklist slot with a class 'blocklist-options' is only + // available when the user has the right to blocklist. + var blocklist_slot = container.one('div.blocklist-options'); - if (blacklist_slot !== null) { + if (blocklist_slot !== null) { // XXX the structure of these widgets means they // are creating side effects on new, but still return // undefined, so can't be used as variables. // eslint-disable-next-line no-new - new BlacklistWidget( - {srcNode: blacklist_slot, + new BlocklistWidget( + {srcNode: blocklist_slot, sourceName: source_name, dsdLink: api_uri, commentWidget: comment_widget }); } - // If the user has not the right to blacklist, we disable - // the blacklist slot. - var disabled_blacklist_slot = container.one( - 'div.blacklist-options-disabled'); - if (disabled_blacklist_slot !== null) { - disabled_blacklist_slot + // If the user has not the right to blocklist, we disable + // the blocklist slot. + var disabled_blocklist_slot = container.one( + 'div.blocklist-options-disabled'); + if (disabled_blocklist_slot !== null) { + disabled_blocklist_slot .all('input').set('disabled', 'disabled'); } // Set-up diffs and the means to request them. @@ -200,16 +200,16 @@ Y.extend(ExpandableRowWidget, Y.Base, { namespace.ExpandableRowWidget = ExpandableRowWidget; /** - * BlacklistWidget: the widget used by each row to control the - * 'blacklisted' status of the DSD. + * BlocklistWidget: the widget used by each row to control the + * 'blocklisted' status of the DSD. */ -function BlacklistWidget(config) { - BlacklistWidget.superclass.constructor.apply(this, arguments); +function BlocklistWidget(config) { + BlocklistWidget.superclass.constructor.apply(this, arguments); } -BlacklistWidget.NAME = "blacklistWidget"; +BlocklistWidget.NAME = "blocklistWidget"; -BlacklistWidget.HTML_PARSER = { +BlocklistWidget.HTML_PARSER = { relatedRows: function(srcNode) { return [ srcNode.ancestor('tr').previous(), @@ -218,14 +218,14 @@ BlacklistWidget.HTML_PARSER = { } }; -Y.extend(BlacklistWidget, Y.Widget, { +Y.extend(BlocklistWidget, Y.Widget, { initializer: function(cfg) { this.sourceName = cfg.sourceName; this.dsdLink = cfg.dsdLink; this.commentWidget = cfg.commentWidget; this.relatedRows = cfg.relatedRows; this.container = cfg.container; - // We call bindUI directly here because the BlacklistWidgets + // We call bindUI directly here because the BlocklistWidgets // are built from existing HTML code and hence we don't // use the full potential of YUI'Widget to manage the // display of the widgets. @@ -238,7 +238,7 @@ Y.extend(BlacklistWidget, Y.Widget, { * */ bindUI: function() { - // Wire the click on blacklist form. + // Wire the click on blocklist form. var handleClick = function(e) { e.preventDefault(); var target = e.target; @@ -247,13 +247,13 @@ Y.extend(BlacklistWidget, Y.Widget, { Y.on("click", handleClick, this.get('srcNode').all('input'), this); // Wire the ok event from the comment overlay. - var handleBlacklistChange = function(e, method_name, blacklist_all, + var handleBlocklistChange = function(e, method_name, blocklist_all, comment, target) { e.preventDefault(); - this.blacklist_submit_handler( - method_name, blacklist_all, comment, target); + this.blocklist_submit_handler( + method_name, blocklist_all, comment, target); }; - this.on("blacklist_changed", handleBlacklistChange, + this.on("blocklist_changed", handleBlocklistChange, this); }, @@ -291,16 +291,16 @@ Y.extend(BlacklistWidget, Y.Widget, { var value = target.get('value'); var method_name = (value === 'NONE') ? 'unblocklist' : 'blocklist'; - var blacklist_all = ( - target.get('value') === 'BLACKLISTED_ALWAYS'); + var blocklist_all = ( + target.get('value') === 'BLOCKLISTED_ALWAYS'); self.fire( - 'blacklist_changed', method_name, blacklist_all, comment, + 'blocklist_changed', method_name, blocklist_all, comment, target); }; var overlay = new Y.lp.ui.FormOverlay({ align: { /* Align the centre of the overlay with the centre of the - node containing the blacklist options. */ + node containing the blocklist options. */ node: this.get('srcNode'), points: [ Y.WidgetPositionAlign.CC, @@ -341,7 +341,7 @@ Y.extend(BlacklistWidget, Y.Widget, { this.get('srcNode').all('input').set('disabled', false); }, - // Duration of the animation fired after each blacklist status change. + // Duration of the animation fired after each blocklist status change. ANIM_DURATION: 1, /** @@ -350,15 +350,15 @@ Y.extend(BlacklistWidget, Y.Widget, { * * @param method_name {String} * 'blocklist' or 'unblocklist'. - * @param blacklist_all {Boolean} - * Is this a blacklist all versions or blacklist current (only - * relevant if method_name is 'blacklist'). + * @param blocklist_all {Boolean} + * Is this a blocklist all versions or blocklist current (only + * relevant if method_name is 'blocklist'). * @param comment {String} * The comment string. * @param target {Node} * The target input node that was clicked. */ - blacklist_submit_handler: function(method_name, blacklist_all, comment, + blocklist_submit_handler: function(method_name, blocklist_all, comment, target) { var self = this; this.lock(); @@ -368,7 +368,7 @@ Y.extend(BlacklistWidget, Y.Widget, { on: { success: function(updated_entry, args) { self.unlock(); - // Let the user know this item is now blacklisted. + // Let the user know this item is now blocklisted. target.set('checked', true); Y.each(diff_rows, function(diff_row) { var fade_to_gray = new Y.Anim({ @@ -379,7 +379,7 @@ Y.extend(BlacklistWidget, Y.Widget, { reverse: (method_name === 'unblocklist') }); fade_to_gray.on('end', function() { - self.fire('blacklisting_animation_ended'); + self.fire('blocklisting_animation_ended'); }); fade_to_gray.run(); }); @@ -392,7 +392,7 @@ Y.extend(BlacklistWidget, Y.Widget, { } }, parameters: { - all: blacklist_all, + all: blocklist_all, comment: comment } }; @@ -400,7 +400,7 @@ Y.extend(BlacklistWidget, Y.Widget, { } }); -namespace.BlacklistWidget = BlacklistWidget; +namespace.BlocklistWidget = BlocklistWidget; /** * Update the latest comment on the difference row. diff --git a/lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.html b/lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.html index 05d4a22..a1af494 100644 --- a/lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.html +++ b/lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.html @@ -92,35 +92,35 @@ GNU Affero General Public License version 3 (see the file LICENSE). </tr> </script> - <script type="text/x-template" id="blacklist_html"> - <div class="blacklist-options" style="float:left"> + <script type="text/x-template" id="blocklist_html"> + <div class="blocklist-options" style="float:left"> <dl> <dt>Ignored:</dt> <dd> <form> <div> <div class="value"> - <label for="field.blacklist_options.0"> + <label for="field.blocklist_options.0"> <input type="radio" value="NONE" - name="field.blacklist_options" - id="field.blacklist_options.0" checked="checked" + name="field.blocklist_options" + id="field.blocklist_options.0" checked="checked" class="radioType"> No</input> </label><br> - <label for="field.blacklist_options.1"> - <input type="radio" value="BLACKLISTED_ALWAYS" - name="field.blacklist_options" - id="field.blacklist_options.1" class="radioType"> + <label for="field.blocklist_options.1"> + <input type="radio" value="BLOCKLISTED_ALWAYS" + name="field.blocklist_options" + id="field.blocklist_options.1" class="radioType"> All versions</input> </label><br> - <label for="field.blacklist_options.2"> - <input type="radio" value="BLACKLISTED_CURRENT" - name="field.blacklist_options" - id="field.blacklist_options.2" + <label for="field.blocklist_options.2"> + <input type="radio" value="BLOCKLISTED_CURRENT" + name="field.blocklist_options" + id="field.blocklist_options.2" class="radioType"> These versions</input> </label> </div> <input type="hidden" value="1" - name="field.blacklist_options-empty-marker" /> + name="field.blocklist_options-empty-marker" /> </div> </form> </dd> @@ -128,7 +128,7 @@ GNU Affero General Public License version 3 (see the file LICENSE). </div> </script> - <script type="text/x-template" id="blacklist_extra_row"> + <script type="text/x-template" id="blocklist_extra_row"> <tr id="extra_row"> <td> <div class="diff-extra-container"> @@ -156,7 +156,7 @@ GNU Affero General Public License version 3 (see the file LICENSE). </dd> </dl> </div> - {blacklist_html} + {blocklist_html} <div class="boardComment "> <div class="boardCommentDetails"> <a class="sprite person" href="/~mark">Mark S.</a> @@ -172,7 +172,7 @@ GNU Affero General Public License version 3 (see the file LICENSE). </td> </tr> </script> - <script type="text/x-template" id="blacklist_whole_table"> + <script type="text/x-template" id="blocklist_whole_table"> <table class="listing"> <tbody> {row} diff --git a/lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js b/lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js index 341b3b0..70f0b3e 100644 --- a/lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js +++ b/lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js @@ -67,12 +67,12 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { var dsd_uri = '/duntu/dwarty/+source/evolution/+difference/ubuntu/warty'; var row_html = Y.one('#localpackagediffs-template').getContent(); var derivedtd_html = Y.one('#derivedtd-template').getContent(); - var blacklist_html = Y.one('#blacklist_html').getContent(); - var extra_row = Y.one('#blacklist_extra_row').getContent(); + var blocklist_html = Y.one('#blocklist_html').getContent(); + var extra_row = Y.one('#blocklist_extra_row').getContent(); extra_row = Y.Lang.sub(extra_row, { - blacklist_html: blacklist_html + blocklist_html: blocklist_html }); - var whole_table = Y.one('#blacklist_whole_table').getContent(); + var whole_table = Y.one('#blocklist_whole_table').getContent(); whole_table = Y.Lang.sub(whole_table, { row: create_row('evolution', '2.0.9-1', '2.0.8-4', false), extra_row: extra_row @@ -188,9 +188,9 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { name: 'package-diff-update-interaction', setUp: function() { Y.one("#placeholder").append(Y.Node.create(whole_table)); - this.node = Y.one('.blacklist-options'); + this.node = Y.one('.blocklist-options'); this.commentWidget = null; - this.widget = new module.BlacklistWidget({ + this.widget = new module.BlocklistWidget({ srcNode: this.node, sourceName: 'evolution', dsdLink: '/a/link', @@ -213,13 +213,13 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { assertIsLocked: function() { var node = this.widget.get('srcNode'); Y.Assert.isNotNull(node.one('img[src="/@@/spinner"]')); - assertAllDisabled(node, 'div.blacklist-options input'); + assertAllDisabled(node, 'div.blocklist-options input'); }, assertIsUnlocked: function() { var node = this.widget.get('srcNode'); Y.Assert.isNull(node.one('img[src="/@@/spinner"]')); - assertAllEnabled(node, 'div.blacklist-options input'); + assertAllEnabled(node, 'div.blocklist-options input'); }, test_lock: function() { @@ -261,9 +261,9 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { Y.Assert.areEqual(this.commentWidget, this.widget.commentWidget); }, - test_wire_blacklist_click: function() { + test_wire_blocklist_click: function() { var input = Y.one( - 'div.blacklist-options input[value="BLACKLISTED_CURRENT"]'); + 'div.blocklist-options input[value="BLOCKLISTED_CURRENT"]'); var fired = false; var show_comment_overlay = function(target) { @@ -276,18 +276,18 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { Y.Assert.isTrue(fired); }, - test_wire_blacklist_changed: function() { + test_wire_blocklist_changed: function() { var fired = false; - var blacklist_submit_handler = function(arg1, arg2, arg3, arg4) { + var blocklist_submit_handler = function(arg1, arg2, arg3, arg4) { fired = true; Y.Assert.areEqual(1, arg1); Y.Assert.areEqual(2, arg2); Y.Assert.areEqual(3, arg3); Y.Assert.areEqual(4, arg4); }; - this.widget.blacklist_submit_handler = blacklist_submit_handler; - this.widget.fire('blacklist_changed', 1, 2, 3, 4); + this.widget.blocklist_submit_handler = blocklist_submit_handler; + this.widget.fire('blocklist_changed', 1, 2, 3, 4); Y.Assert.isTrue(fired); }, @@ -297,7 +297,7 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { }, test_show_comment_overlay_creates_overlay: function() { - var input = Y.one('div.blacklist-options input'); + var input = Y.one('div.blocklist-options input'); var overlay = this.widget.show_comment_overlay(input); // Check overlay's structure. Y.Assert.isInstanceOf(Y.lp.ui.FormOverlay, overlay); @@ -312,7 +312,7 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { }, test_show_comment_overlay_cancel_hides_overlay: function() { - var input = Y.one('div.blacklist-options input'); + var input = Y.one('div.blocklist-options input'); var overlay = this.widget.show_comment_overlay(input); var cancel_button = overlay.form_node.one('button[type="button"]'); Y.Assert.isTrue(overlay.get('visible')); @@ -321,7 +321,7 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { }, test_show_comment_overlay_ok_hides_overlay: function() { - var input = Y.one('div.blacklist-options input'); + var input = Y.one('div.blocklist-options input'); var overlay = this.widget.show_comment_overlay(input); Y.Assert.isTrue(overlay.get('visible')); overlay.form_node.one('button[type="submit"]').simulate('click'); @@ -329,7 +329,7 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { }, test_show_comment_overlay_fires_event: function() { - var input = Y.one('div.blacklist-options input[value="NONE"]'); + var input = Y.one('div.blocklist-options input[value="NONE"]'); input.set('checked', true); var overlay = this.widget.show_comment_overlay(input); var event_fired = false; @@ -347,7 +347,7 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { target = e_target; }; - this.widget.on("blacklist_changed", handleEvent, this.widget); + this.widget.on("blocklist_changed", handleEvent, this.widget); overlay.form_node.one('textarea').set('text', 'Test comment'); overlay.form_node.one('button[type="submit"]').simulate('click'); @@ -359,9 +359,9 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { Y.Assert.areEqual(input, target); }, - test_show_comment_overlay_fires_event_blacklist_all: function() { + test_show_comment_overlay_fires_event_blocklist_all: function() { var input = Y.one( - 'div.blacklist-options input[value="BLACKLISTED_ALWAYS"]'); + 'div.blocklist-options input[value="BLOCKLISTED_ALWAYS"]'); input.set('checked', true); var overlay = this.widget.show_comment_overlay(input); var method = null; @@ -374,7 +374,7 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { all = e_all; target = e_target; }; - this.widget.on("blacklist_changed", handleEvent, this.widget); + this.widget.on("blocklist_changed", handleEvent, this.widget); overlay.form_node.one('button[type="submit"]').simulate('click'); Y.Assert.areEqual('blocklist', method); @@ -382,9 +382,9 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { Y.Assert.areEqual(input, target); }, - test_show_comment_overlay_fires_event_blacklist: function() { + test_show_comment_overlay_fires_event_blocklist: function() { var input = Y.one( - 'div.blacklist-options input[value="BLACKLISTED_CURRENT"]'); + 'div.blocklist-options input[value="BLOCKLISTED_CURRENT"]'); input.set('checked', true); var overlay = this.widget.show_comment_overlay(input); var method = null; @@ -397,7 +397,7 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { all = e_all; target = e_target; }; - this.widget.on("blacklist_changed", handleEvent, this.widget); + this.widget.on("blocklist_changed", handleEvent, this.widget); overlay.form_node.one('button[type="submit"]').simulate('click'); Y.Assert.areEqual('blocklist', method); @@ -405,16 +405,16 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { Y.Assert.areEqual(input, target); }, - test_blacklist_submit_handler_null_comment_widget: function() { + test_blocklist_submit_handler_null_comment_widget: function() { // The widget can cope with a null commentWidget. Y.Assert.isNull(this.widget.commentWidget); var input = Y.one( - 'div.blacklist-options input[value="BLACKLISTED_CURRENT"]'); - this.widget.blacklist_submit_handler( + 'div.blocklist-options input[value="BLOCKLISTED_CURRENT"]'); + this.widget.blocklist_submit_handler( 'blocklist', false, "Test comment", input); }, - test_blacklist_submit_handler_blacklist_simple: function() { + test_blocklist_submit_handler_blocklist_simple: function() { var mockCommentWidget = Y.Mock(); Y.Mock.expect(mockCommentWidget, { method: "display_new_comment", @@ -426,7 +426,7 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { 'blocklist', {comment: 'Test comment', all: false}); var input = Y.one( - 'div.blacklist-options input[value="BLACKLISTED_CURRENT"]'); + 'div.blocklist-options input[value="BLOCKLISTED_CURRENT"]'); input.set('checked', false); var fired = 0; @@ -436,8 +436,8 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { // we had the chance to call this.wait(). fired += 1; }; - this.widget.on('blacklisting_animation_ended', listener); - this.widget.blacklist_submit_handler( + this.widget.on('blocklisting_animation_ended', listener); + this.widget.blocklist_submit_handler( 'blocklist', false, "Test comment", input); Y.Assert.isTrue(input.get('checked')); @@ -448,7 +448,7 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { }, 1000); }, - test_blacklist_submit_handler_blacklist_all: function() { + test_blocklist_submit_handler_blocklist_all: function() { var mockCommentWidget = Y.Mock(); Y.Mock.expect(mockCommentWidget, { method: "display_new_comment", @@ -460,7 +460,7 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { 'blocklist', {comment: 'Test comment', all: true}); var input = Y.one( - 'div.blacklist-options input[value="BLACKLISTED_CURRENT"]'); + 'div.blocklist-options input[value="BLOCKLISTED_CURRENT"]'); input.set('checked', false); var fired = 0; @@ -470,8 +470,8 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { // we had the chance to call this.wait(). fired += 1; }; - this.widget.on('blacklisting_animation_ended', listener); - this.widget.blacklist_submit_handler( + this.widget.on('blocklisting_animation_ended', listener); + this.widget.blocklist_submit_handler( 'blocklist', true, "Test comment", input); Y.Assert.isTrue(input.get('checked')); @@ -497,15 +497,15 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { all: true }); - var input = Y.one('div.blacklist-options input[value="NONE"]'); + var input = Y.one('div.blocklist-options input[value="NONE"]'); input.set('checked', false); var listener = function (ev) { fired = true; }; - this.widget.on('blacklisting_animation_ended', listener); - this.widget.blacklist_submit_handler( + this.widget.on('blocklisting_animation_ended', listener); + this.widget.blocklist_submit_handler( 'unblocklist', true, "Test comment", input); Y.Assert.isTrue(input.get('checked')); @@ -515,16 +515,16 @@ YUI.add('lp.registry.distroseriesdifferences_details.test', function (Y) { }, 1000); }, - test_blacklist_submit_handler_failure: function() { + test_blocklist_submit_handler_failure: function() { var that = this; module.lp_client.named_post = function(url, func, config) { that.assertIsLocked(); config.on.failure(); that.assertIsUnlocked(); }; - var input = Y.one('div.blacklist-options input'); + var input = Y.one('div.blocklist-options input'); input.set('checked', false); - this.widget.blacklist_submit_handler( + this.widget.blocklist_submit_handler( null, 'unblocklist', true, "Test comment", input); } })); diff --git a/lib/lp/registry/model/distroseriesdifference.py b/lib/lp/registry/model/distroseriesdifference.py index d7b942a..64c3a0b 100644 --- a/lib/lp/registry/model/distroseriesdifference.py +++ b/lib/lp/registry/model/distroseriesdifference.py @@ -788,7 +788,7 @@ class DistroSeriesDifference(StormBase): Check whether the status of this difference should be updated. :param manual: Boolean, True if this is a user-requested change. - This overrides auto-blacklisting. + This overrides auto-blocklisting. """ # XXX 2011-05-20 bigjools bug=785657 # This method needs updating to use some sort of state @@ -809,9 +809,9 @@ class DistroSeriesDifference(StormBase): self.source_version = new_source_version updated = True # If the derived version has change and the previous version - # was blacklisted, then we remove the blacklist now. + # was blocklisted, then we remove the blocklist now. if self.status == ( - DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT + DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT ): self.status = DistroSeriesDifferenceStatus.NEEDS_ATTENTION if self.parent_source_pub: @@ -853,16 +853,16 @@ class DistroSeriesDifference(StormBase): and not manual ): # The child was updated with a higher version so it's - # auto-blacklisted. + # auto-blocklisted. updated = True - self.status = DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT + self.status = DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT # If this difference was needing attention, or the current version - # was blacklisted and the versions now match we resolve it. Note: - # we don't resolve it if this difference was blacklisted for all + # was blocklisted and the versions now match we resolve it. Note: + # we don't resolve it if this difference was blocklisted for all # versions. elif self.status in ( DistroSeriesDifferenceStatus.NEEDS_ATTENTION, - DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, + DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, ): if ( apt_pkg.version_compare( @@ -880,8 +880,8 @@ class DistroSeriesDifference(StormBase): and not manual ): # If the derived version is lower than the parent's, we - # ensure the diff status is blacklisted. - self.status = DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT + # ensure the diff status is blocklisted. + self.status = DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT if self._updateBaseVersion(): updated = True @@ -961,9 +961,9 @@ class DistroSeriesDifference(StormBase): def blocklist(self, commenter, all=False, comment=None): """See `IDistroSeriesDifference`.""" if all: - new_status = DistroSeriesDifferenceStatus.BLACKLISTED_ALWAYS + new_status = DistroSeriesDifferenceStatus.BLOCKLISTED_ALWAYS else: - new_status = DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT + new_status = DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT new_comment = self._getCommentWithStatusChange(new_status, comment) dsd_comment = self.addComment(commenter, new_comment) self.status = new_status diff --git a/lib/lp/registry/templates/distroseries-localdifferences.pt b/lib/lp/registry/templates/distroseries-localdifferences.pt index 497a4da..917cd54 100644 --- a/lib/lp/registry/templates/distroseries-localdifferences.pt +++ b/lib/lp/registry/templates/distroseries-localdifferences.pt @@ -25,7 +25,7 @@ width: 100%; margin: 0 0 -1px; } - table.listing .blacklist-options { + table.listing .blocklist-options { padding-left: 1em; } </style> diff --git a/lib/lp/registry/templates/distroseriesdifference-listing-extra.pt b/lib/lp/registry/templates/distroseriesdifference-listing-extra.pt index e30a513..1b76568 100644 --- a/lib/lp/registry/templates/distroseriesdifference-listing-extra.pt +++ b/lib/lp/registry/templates/distroseriesdifference-listing-extra.pt @@ -113,14 +113,14 @@ </dl> </div> <div - tal:attributes="class view/blacklist_options_css_class" + tal:attributes="class view/blocklist_options_css_class" style="float:left"> <dl> <dt>Ignored:</dt> <dd> <form> <tal:replace - replace="structure view/widgets/blacklist_options" /> + replace="structure view/widgets/blocklist_options" /> </form> </dd> </dl> diff --git a/lib/lp/registry/tests/test_distroseriesdifference.py b/lib/lp/registry/tests/test_distroseriesdifference.py index 9b4f2c7..5195913 100644 --- a/lib/lp/registry/tests/test_distroseriesdifference.py +++ b/lib/lp/registry/tests/test_distroseriesdifference.py @@ -252,7 +252,7 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): def test_child_update_re_opens_difference(self): # The status of a resolved difference will updated to - # BLACKLISTED_CURRENT with child uploads. + # BLOCKLISTED_CURRENT with child uploads. ds_diff = self.factory.makeDistroSeriesDifference( source_package_name_str="foonew", versions=dict(parent="1.0", derived="1.0"), @@ -269,7 +269,7 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): self.assertTrue(was_updated) self.assertEqual( - DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, ds_diff.status + DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, ds_diff.status ) def test_update_new_parent_version_doesnt_change_status(self): @@ -326,8 +326,8 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): ds_diff.difference_type, ) - def test_update_removes_version_blacklist(self): - # A blacklist on a version of a package is removed when a new + def test_update_removes_version_blocklist(self): + # A blocklist on a version of a package is removed when a new # version is uploaded to the derived series. ds_diff = self.factory.makeDistroSeriesDifference( source_package_name_str="foonew", @@ -337,7 +337,7 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): difference_type=( DistroSeriesDifferenceType.UNIQUE_TO_DERIVED_SERIES ), - status=DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, + status=DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, ) self.factory.makeSourcePackagePublishingHistory( sourcepackagename=ds_diff.source_package_name, @@ -353,18 +353,18 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): DistroSeriesDifferenceStatus.NEEDS_ATTENTION, ds_diff.status ) - def test_update_does_not_remove_permanent_blacklist(self): - # A permanent blacklist is not removed when a new version + def test_update_does_not_remove_permanent_blocklist(self): + # A permanent blocklist is not removed when a new version # is uploaded, even if it resolves the difference (as later # uploads could re-create a difference, and we want to keep - # the blacklist). + # the blocklist). ds_diff = self.factory.makeDistroSeriesDifference( source_package_name_str="foonew", versions={ "derived": "0.9", "parent": "1.0", }, - status=DistroSeriesDifferenceStatus.BLACKLISTED_ALWAYS, + status=DistroSeriesDifferenceStatus.BLOCKLISTED_ALWAYS, ) self.factory.makeSourcePackagePublishingHistory( sourcepackagename=ds_diff.source_package_name, @@ -377,7 +377,7 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): self.assertTrue(was_updated) self.assertEqual( - DistroSeriesDifferenceStatus.BLACKLISTED_ALWAYS, ds_diff.status + DistroSeriesDifferenceStatus.BLOCKLISTED_ALWAYS, ds_diff.status ) def test_title(self): @@ -486,7 +486,7 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): ) def test_blocklist_unauthorised(self): - # If you're not an archive admin, you don't get to blacklist or + # If you're not an archive admin, you don't get to blocklist or # unblocklist. ds_diff = self.factory.makeDistroSeriesDifference() random_joe = self.factory.makePerson() @@ -505,7 +505,7 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): ds_diff.blocklist(admin) self.assertEqual( - DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, ds_diff.status + DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, ds_diff.status ) def test_blocklist_all(self): @@ -519,13 +519,13 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): ds_diff.blocklist(admin, all=True) self.assertEqual( - DistroSeriesDifferenceStatus.BLACKLISTED_ALWAYS, ds_diff.status + DistroSeriesDifferenceStatus.BLOCKLISTED_ALWAYS, ds_diff.status ) def test_unblocklist(self): # Unblocklisting will return to NEEDS_ATTENTION by default. ds_diff = self.factory.makeDistroSeriesDifference( - status=DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT + status=DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT ) admin = self.factory.makeArchiveAdmin( ds_diff.derived_series.main_archive @@ -545,7 +545,7 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): "derived": "0.9", "parent": "1.0", }, - status=DistroSeriesDifferenceStatus.BLACKLISTED_ALWAYS, + status=DistroSeriesDifferenceStatus.BLOCKLISTED_ALWAYS, ) self.factory.makeSourcePackagePublishingHistory( sourcepackagename=ds_diff.source_package_name, @@ -565,7 +565,7 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): def test_get_comment_with_status_change(self): # Test the new comment string created to describe a status # change. - old_status = DistroSeriesDifferenceStatus.BLACKLISTED_ALWAYS + old_status = DistroSeriesDifferenceStatus.BLOCKLISTED_ALWAYS new_status = DistroSeriesDifferenceStatus.NEEDS_ATTENTION new_comment = get_comment_with_status_change( old_status, new_status, "simple comment" @@ -584,7 +584,7 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): ) def test_unblocklist_creates_comment(self): - old_status = DistroSeriesDifferenceStatus.BLACKLISTED_ALWAYS + old_status = DistroSeriesDifferenceStatus.BLOCKLISTED_ALWAYS ds_diff = self.factory.makeDistroSeriesDifference( status=old_status, source_package_name_str="foo" ) @@ -613,7 +613,7 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): dsd_comment = ds_diff.blocklist( admin, True, "Wait until version 2.1" ) - new_status = DistroSeriesDifferenceStatus.BLACKLISTED_ALWAYS + new_status = DistroSeriesDifferenceStatus.BLOCKLISTED_ALWAYS expected_comment = "Wait until version 2.1\n\nIgnored: %s => %s" % ( old_status.title, new_status.title, @@ -1205,7 +1205,7 @@ class DistroSeriesDifferenceSourceTestCase(TestCaseWithFactory): series = self.makeDerivedSeries() dsds = self.makeDifferencesForAllStatuses(series) dsd_source = getUtility(IDistroSeriesDifferenceSource) - wanted_status = DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT + wanted_status = DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT self.assertContentEqual( [dsds[wanted_status]], dsd_source.getForDistroSeries(series, status=wanted_status), @@ -1216,7 +1216,7 @@ class DistroSeriesDifferenceSourceTestCase(TestCaseWithFactory): series = self.makeDerivedSeries() dsds = self.makeDifferencesForAllStatuses(series) wanted_statuses = ( - DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, + DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, DistroSeriesDifferenceStatus.NEEDS_ATTENTION, ) dsd_source = getUtility(IDistroSeriesDifferenceSource) @@ -1433,8 +1433,8 @@ class DistroSeriesDifferenceSourceTestCase(TestCaseWithFactory): def test_getSimpleUpgrades_ignores_hidden_differences(self): invisible_statuses = [ - DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, - DistroSeriesDifferenceStatus.BLACKLISTED_ALWAYS, + DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, + DistroSeriesDifferenceStatus.BLOCKLISTED_ALWAYS, DistroSeriesDifferenceStatus.RESOLVED, ] dsd_source = getUtility(IDistroSeriesDifferenceSource) diff --git a/lib/lp/soyuz/tests/test_distroseriesdifferencejob.py b/lib/lp/soyuz/tests/test_distroseriesdifferencejob.py index 6f372ff..b0a2e63 100644 --- a/lib/lp/soyuz/tests/test_distroseriesdifferencejob.py +++ b/lib/lp/soyuz/tests/test_distroseriesdifferencejob.py @@ -780,7 +780,7 @@ class TestDistroSeriesDifferenceJobEndToEnd(TestCaseWithFactory): def test_child_gets_newer(self): # When a new source is uploaded to the child distroseries, the DSD is - # updated and auto-blacklisted. + # updated and auto-blocklisted. dsp = self.makeDerivedDistroSeries() source_package_name = self.factory.makeSourcePackageName() self.createPublication( @@ -805,11 +805,11 @@ class TestDistroSeriesDifferenceJobEndToEnd(TestCaseWithFactory): ) self.runJob(jobs[0]) self.assertEqual( - DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, ds_diff[0].status + DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, ds_diff[0].status ) self.assertEqual("1.0-1", ds_diff[0].base_version) - # An additional upload should not change the blacklisted status. + # An additional upload should not change the blocklisted status. self.createPublication( source_package_name, ["2.0-0derived2", "1.0-1"], dsp.derived_series ) @@ -818,7 +818,7 @@ class TestDistroSeriesDifferenceJobEndToEnd(TestCaseWithFactory): ) self.runJob(jobs[0]) self.assertEqual( - DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT, ds_diff[0].status + DistroSeriesDifferenceStatus.BLOCKLISTED_CURRENT, ds_diff[0].status ) def test_child_is_synced(self):
_______________________________________________ Mailing list: https://launchpad.net/~launchpad-reviewers Post to : launchpad-reviewers@lists.launchpad.net Unsubscribe : https://launchpad.net/~launchpad-reviewers More help : https://help.launchpad.net/ListHelp