Merge ~pappacena/launchpad:fix-distribution-broken-tests into launchpad:master

Proposed by Thiago F. Pappacena
Status: Merged
Approved by: Thiago F. Pappacena
Approved revision: 3ba2b8cf875091388f730fb77465222972531194
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~pappacena/launchpad:fix-distribution-broken-tests
Merge into: launchpad:master
Diff against target: 27 lines (+2/-3)
1 file modified
lib/lp/registry/browser/distribution.py (+2/-3)
Reviewer Review Type Date Requested Status
Thiago F. Pappacena (community) Approve
Review via email: mp+383993@code.launchpad.net

Commit message

Fixing broken distribution test.

A previous MP (https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/383657) introduced our standard `from __future__ import absolute_import, print_function, unicode_literals` in lp/registry/browser/distribution.py, but the tests were not prepared for this. This fixes the regression, but it would be interesting to run the full suite and include back this `from __future__ import` statement.

To post a comment you must log in.
Revision history for this message
Thiago F. Pappacena (pappacena) wrote :

Self-approving to fix build bot.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/registry/browser/distribution.py b/lib/lp/registry/browser/distribution.py
2index 128b429..ffabedb 100644
3--- a/lib/lp/registry/browser/distribution.py
4+++ b/lib/lp/registry/browser/distribution.py
5@@ -3,8 +3,6 @@
6
7 """Browser views for distributions."""
8
9-from __future__ import absolute_import, print_function, unicode_literals
10-
11 __metaclass__ = type
12
13 __all__ = [
14@@ -44,6 +42,7 @@ from collections import defaultdict
15 import datetime
16
17 from lazr.restful.utils import smartquote
18+import six
19 from zope.component import getUtility
20 from zope.event import notify
21 from zope.formlib import form
22@@ -1423,4 +1422,4 @@ class DistributionOCIProjectSearchView(LaunchpadView):
23 @property
24 def search_results(self):
25 return getUtility(IOCIProjectSet).findByDistributionAndName(
26- self.context, self.text or '')
27+ self.context, self.text or six.ensure_text(''))