Merge lp:~sinzui/launchpad/enable-project-suggetions into lp:launchpad/db-devel

Proposed by Curtis Hovey
Status: Merged
Approved by: Brad Crittenden
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~sinzui/launchpad/enable-project-suggetions
Merge into: lp:launchpad/db-devel
Diff against target: 0 lines
To merge this branch: bzr merge lp:~sinzui/launchpad/enable-project-suggetions
Reviewer Review Type Date Requested Status
Francis J. Lacoste (community) release-critical Approve
Brad Crittenden (community) code Approve
Review via email: mp+24608@code.launchpad.net

Commit message

Enable project package suggestions.

Description of the change

This is my branch to enable package suggestions on the project page_title.

    lp:~sinzui/launchpad/enable-project-suggetions
    Diff size: 70
    Launchpad bug: https://bugs.launchpad.net/bugs/574431
    Test command: ./bin/test -vv -t product-portlet-packages-view.txt
    Pre-implementation: bac
    Target release: 10.04

Enable package suggestions on the project page_title
----------------------------------------------------

The project package suggestions portlet is ready for release so the guard
that prevents it from being seen on lpnet can be removed.

QA
--

Not QAable in this case. I verified that the portlet is show in the test
suite by removing the code and watching the old test fail.

Lint
----

Linting changed files:
  lib/lp/registry/browser/product.py
  lib/lp/registry/browser/tests/product-portlet-packages-view.txt

Test
----

    * lib/lp/registry/browser/tests/product-portlet-packages-view.txt
      Removed test that verified the guard.

Implementation
--------------

    * lib/lp/registry/browser/product.py
      Removed the or-condition for lpnet.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Since the branch scanner is busy, here is the diff http://pastebin.ubuntu.com/427084:

=== modified file 'lib/lp/registry/browser/product.py'
--- lib/lp/registry/browser/product.py 2010-04-27 13:57:18 +0000
+++ lib/lp/registry/browser/product.py 2010-05-03 14:23:16 +0000
@@ -1070,7 +1070,7 @@
         """Are there packages, or can packages be suggested."""
         if len(self.sourcepackages) > 0:
             return True
- if self.user is None or config.launchpad.is_lpnet:
+ if self.user is None:
             return False
         date_next_suggest_packaging = self.context.date_next_suggest_packaging
         return (

=== modified file 'lib/lp/registry/browser/tests/product-portlet-packages-view.txt'
--- lib/lp/registry/browser/tests/product-portlet-packages-view.txt 2010-04-27 13:57:18 +0000
+++ lib/lp/registry/browser/tests/product-portlet-packages-view.txt 2010-05-03 14:38:35 +0000
@@ -225,44 +225,6 @@
     >>> view.can_show_portlet
     False

-The can_show_portlet property indicates that the portlet can be rendered. The
-portlet is not rendered if there are no source packages and the environment
-is lpnet.
-
- >>> config.launchpad.is_lpnet
- False
-
- >>> login_person(product.owner)
- >>> view = create_initialized_view(
- ... product, name="+portlet-packages", principal=product.owner)
- >>> view.sourcepackages
- []
-
- >>> view.can_show_portlet
- True
-
- >>> print extract_text(view.render())
- All packages
- Packages in Ubuntu ...
-
- >>> test_data = """
- ... [launchpad]
- ... is_lpnet: True
- ... """
- >>> config.push('test_data', test_data)
- >>> config.launchpad.is_lpnet
- True
-
- >>> view = create_initialized_view(
- ... product, name="+portlet-packages", principal=product.owner)
- >>> view.can_show_portlet
- False
-
- >>> print extract_text(view.render())
- <BLANKLINE>
-
- >>> ignore = config.pop('test_data')
-
 The can_show_portlet property is False when
 product.date_next_suggest_packaging is None or the date is more than one
 year ago.
@@ -273,6 +235,7 @@
     >>> print product.date_next_suggest_packaging
     None

+ >>> login_person(product.owner)
     >>> view = create_initialized_view(
     ... product, name="+portlet-packages", principal=product.owner)
     >>> view.can_show_portlet

Revision history for this message
Brad Crittenden (bac) :
review: Approve (code)
Revision history for this message
Francis J. Lacoste (flacoste) :
review: Approve (release-critical)

Preview Diff

Empty

Subscribers

People subscribed via source and target branches

to status/vote changes: