Merge lp:~nigelbabu/launchpad/645825-ui-example into lp:launchpad

Proposed by Nigel Babu on 2011-05-16
Status: Merged
Approved by: Graham Binns on 2011-05-17
Approved revision: no longer in the source branch.
Merged at revision: 13073
Proposed branch: lp:~nigelbabu/launchpad/645825-ui-example
Merge into: lp:launchpad
Diff against target: 61 lines (+33/-2)
3 files modified
lib/lp/registry/browser/tests/ (+31/-0)
lib/lp/registry/templates/ (+1/-1)
lib/lp/registry/templates/ (+1/-1)
To merge this branch: bzr merge lp:~nigelbabu/launchpad/645825-ui-example
Reviewer Review Type Date Requested Status
Steve Kowalik (community) code 2011-05-16 Approve on 2011-05-18
Graham Binns (community) code Approve on 2011-05-17
Review via email:

Commit Message

[r=gmb,stevenk] [r=gmb][bug=645825] The ProductSeries:+code-summary page now uses the when providing branch URLs rather than just relying on the default series name for the product.

Description of the Change

The pages that show, or let me choose, the branch for a productseries tell me I can create the branch with "bzr push." They give a full example command line with the right product name, but the productseries name always seems to be "trunk" rather than the name of the series I'm actually trying to set a branch for. Fixed the hardcoded trunk with name of the series.

To post a comment you must log in.
Steve Kowalik (stevenk) wrote :

This change looks great, but I don't think it's ready to land -- I'd like to see some test changes or test additions first.

review: Needs Fixing
Graham Binns (gmb) wrote :

Blood, sweat, tears and tests. As I mentioned on IRC, the test needs a leading comment explaining the expected behaviour. Other than that, this is good to go.

review: Approve (code)
Steve Kowalik (stevenk) :
review: Approve (code)
Graham Binns (gmb) wrote :

There were some test failures in this branch when I ran it through
EC2, but they came shortly after the devel build had failed. I'll
check to make sure that the failures weren't a result of whatever
caused the build failure.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'lib/lp/registry/browser/tests/'
2--- lib/lp/registry/browser/tests/ 1970-01-01 00:00:00 +0000
3+++ lib/lp/registry/browser/tests/ 2011-05-18 04:15:51 +0000
4@@ -0,0 +1,31 @@
5+# Copyright 2011 Canonical Ltd. This software is licensed under the
6+# GNU Affero General Public License version 3 (see the file LICENSE).
8+"""View tests for ProductSeries pages."""
10+__metaclass__ = type
12+from canonical.testing.layers import DatabaseFunctionalLayer
13+from lp.testing import (
14+ TestCaseWithFactory,
15+ person_logged_in
16+ )
17+from lp.testing.views import create_initialized_view
18+from lp.testing.matchers import Contains
21+class TestProductSeriesHelp(TestCaseWithFactory):
22+ layer = DatabaseFunctionalLayer
24+ def test_new_series_help(self):
25+ # The LP branch URL displayed to the user on the +code-summary page for
26+ # a product series will relate to that series instead of to the default
27+ # series for the Product.
28+ product = self.factory.makeProduct()
29+ series = self.factory.makeProductSeries(product=product)
30+ person = product.owner
31+ ssh_key = self.factory.makeSSHKey(person=person)
32+ branch_url = "lp:~%s/%s/%s" % (,,
33+ with person_logged_in(person):
34+ view = create_initialized_view(series, '+code-summary')
35+ self.assertThat(view(), Contains(branch_url))
37=== modified file 'lib/lp/registry/templates/'
38--- lib/lp/registry/templates/ 2011-01-17 21:03:16 +0000
39+++ lib/lp/registry/templates/ 2011-05-18 04:15:51 +0000
40@@ -41,7 +41,7 @@
41 <li id="ssh-key-directions">
42 Push the branch directly to Launchpad, e.g. with:<br />
43 <tt><strong>
44- bzr push lp:~<tal:user replace="view/user/name"/>/<tal:project replace="context/product/name"/>/trunk
45+ bzr push lp:~<tal:user replace="view/user/name"/>/<tal:products replace="context/product/name"/>/<tal:series replace="context/name"/>
46 </strong></tt>
47 <tal:no-keys condition="not:view/user/sshkeys">
48 <br/>To authenticate with the Launchpad branch upload service,
50=== modified file 'lib/lp/registry/templates/'
51--- lib/lp/registry/templates/ 2011-01-17 20:39:15 +0000
52+++ lib/lp/registry/templates/ 2011-05-18 04:15:51 +0000
53@@ -28,7 +28,7 @@
54 <li id="ssh-key-directions">
55 Push the branch directly to Launchpad, e.g. with:<br />
56 <tt><strong>
57- bzr push lp:~<tal:user replace="view/user/name"/>/<tal:project replace="context/product/name"/>/trunk
58+ bzr push lp:~<tal:user replace="view/user/name"/>/<tal:project replace="context/product/name"/>/<tal:series replace="context/name"/>
59 </strong></tt>
60 <tal:no-keys condition="not:view/user/sshkeys">
61 <br/>To authenticate with the Launchpad branch upload service,