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

Proposed by Nigel Babu
Status: Merged
Approved by: Graham Binns
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/test_productseries_views.py (+31/-0)
lib/lp/registry/templates/productseries-codesummary.pt (+1/-1)
lib/lp/registry/templates/productseries-linkbranch.pt (+1/-1)
To merge this branch: bzr merge lp:~nigelbabu/launchpad/645825-ui-example
Reviewer Review Type Date Requested Status
Steve Kowalik (community) code Approve
Graham Binns (community) code Approve
Review via email: mp+61175@code.launchpad.net

Commit message

[r=gmb,stevenk] [r=gmb][bug=645825] The ProductSeries:+code-summary page now uses the ProductSeries.name 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.
Revision history for this message
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
Revision history for this message
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)
Revision history for this message
Steve Kowalik (stevenk) :
review: Approve (code)
Revision history for this message
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/test_productseries_views.py'
2--- lib/lp/registry/browser/tests/test_productseries_views.py 1970-01-01 00:00:00 +0000
3+++ lib/lp/registry/browser/tests/test_productseries_views.py 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).
7+
8+"""View tests for ProductSeries pages."""
9+
10+__metaclass__ = type
11+
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
19+
20+
21+class TestProductSeriesHelp(TestCaseWithFactory):
22+ layer = DatabaseFunctionalLayer
23+
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" % (person.name, product.name, series.name)
33+ with person_logged_in(person):
34+ view = create_initialized_view(series, '+code-summary')
35+ self.assertThat(view(), Contains(branch_url))
36
37=== modified file 'lib/lp/registry/templates/productseries-codesummary.pt'
38--- lib/lp/registry/templates/productseries-codesummary.pt 2011-01-17 21:03:16 +0000
39+++ lib/lp/registry/templates/productseries-codesummary.pt 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,
49
50=== modified file 'lib/lp/registry/templates/productseries-linkbranch.pt'
51--- lib/lp/registry/templates/productseries-linkbranch.pt 2011-01-17 20:39:15 +0000
52+++ lib/lp/registry/templates/productseries-linkbranch.pt 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,