Merge lp:~stevenk/launchpad/uploaded-packages-wrong-link into lp:launchpad

Proposed by Steve Kowalik
Status: Merged
Approved by: Robert Collins
Approved revision: no longer in the source branch.
Merged at revision: 13435
Proposed branch: lp:~stevenk/launchpad/uploaded-packages-wrong-link
Merge into: lp:launchpad
Diff against target: 52 lines (+16/-1)
2 files modified
lib/lp/registry/browser/tests/test_person_view.py (+15/-0)
lib/lp/registry/templates/person-macros.pt (+1/-1)
To merge this branch: bzr merge lp:~stevenk/launchpad/uploaded-packages-wrong-link
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+67916@code.launchpad.net

Commit message

[r=lifeless][bug=799308] Correct link for questions on ~/+uploaded-packages.

Description of the change

Correct the link for Questions on ~/+uploaded-packages, and add a test for the bug and answers links, since I couldn't locate one.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) :
review: Approve
Revision history for this message
Robert Collins (lifeless) wrote :

My only comment is that this:

35 + for suffix in ('+bugs', '+questions'):
36 + self.assertIn('<a href="%s%s">' % (expected_base, suffix), html)

is no shorter, and may well be harder to debug that two separate assertions.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/browser/tests/test_person_view.py'
2--- lib/lp/registry/browser/tests/test_person_view.py 2011-05-27 21:12:25 +0000
3+++ lib/lp/registry/browser/tests/test_person_view.py 2011-07-14 07:11:13 +0000
4@@ -47,6 +47,7 @@
5 from lp.registry.model.milestone import milestone_sort_key
6 from lp.registry.model.person import Person
7 from lp.soyuz.enums import (
8+ ArchivePurpose,
9 ArchiveStatus,
10 PackagePublishingStatus,
11 )
12@@ -595,6 +596,11 @@
13 def setUp(self):
14 super(TestPersonUploadedPackagesView, self).setUp()
15 self.user = self.factory.makePerson()
16+ archive = self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY)
17+ spr = self.factory.makeSourcePackageRelease(
18+ creator=self.user, archive=archive)
19+ self.spph = self.factory.makeSourcePackagePublishingHistory(
20+ sourcepackagerelease=spr, archive=archive)
21 self.view = create_initialized_view(self.user, '+uploaded-packages')
22
23 def test_view_helper_attributes(self):
24@@ -605,6 +611,15 @@
25 config.launchpad.default_batch_size,
26 self.view.max_results_to_display)
27
28+ def test_verify_bugs_and_answers_links(self):
29+ # Verify the links for bugs and answers point to locations that
30+ # exist.
31+ html = self.view()
32+ expected_base = '/%s/+source/%s' % (
33+ self.spph.distroseries.distribution.name,
34+ self.spph.source_package_name)
35+ self.assertIn('<a href="%s/+bugs">' % expected_base, html)
36+ self.assertIn('<a href="%s/+questions">' % expected_base, html)
37
38 class TestPersonPPAPackagesView(TestCaseWithFactory):
39 """Test the maintained packages view."""
40
41=== modified file 'lib/lp/registry/templates/person-macros.pt'
42--- lib/lp/registry/templates/person-macros.pt 2011-02-01 19:16:43 +0000
43+++ lib/lp/registry/templates/person-macros.pt 2011-07-14 07:11:13 +0000
44@@ -173,7 +173,7 @@
45 </a>
46 </td>
47 <td style="text-align: right">
48- <a tal:attributes="href string:${spr/sourcepackage/fmt:url}/+questions"
49+ <a tal:attributes="href string:${spr/distrosourcepackage/fmt:url}/+questions"
50 tal:content="spr/open_questions">
51 </a>
52 </td>