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
=== modified file 'lib/lp/registry/browser/tests/test_person_view.py'
--- lib/lp/registry/browser/tests/test_person_view.py 2011-05-27 21:12:25 +0000
+++ lib/lp/registry/browser/tests/test_person_view.py 2011-07-14 07:11:13 +0000
@@ -47,6 +47,7 @@
47from lp.registry.model.milestone import milestone_sort_key47from lp.registry.model.milestone import milestone_sort_key
48from lp.registry.model.person import Person48from lp.registry.model.person import Person
49from lp.soyuz.enums import (49from lp.soyuz.enums import (
50 ArchivePurpose,
50 ArchiveStatus,51 ArchiveStatus,
51 PackagePublishingStatus,52 PackagePublishingStatus,
52 )53 )
@@ -595,6 +596,11 @@
595 def setUp(self):596 def setUp(self):
596 super(TestPersonUploadedPackagesView, self).setUp()597 super(TestPersonUploadedPackagesView, self).setUp()
597 self.user = self.factory.makePerson()598 self.user = self.factory.makePerson()
599 archive = self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY)
600 spr = self.factory.makeSourcePackageRelease(
601 creator=self.user, archive=archive)
602 self.spph = self.factory.makeSourcePackagePublishingHistory(
603 sourcepackagerelease=spr, archive=archive)
598 self.view = create_initialized_view(self.user, '+uploaded-packages')604 self.view = create_initialized_view(self.user, '+uploaded-packages')
599605
600 def test_view_helper_attributes(self):606 def test_view_helper_attributes(self):
@@ -605,6 +611,15 @@
605 config.launchpad.default_batch_size,611 config.launchpad.default_batch_size,
606 self.view.max_results_to_display)612 self.view.max_results_to_display)
607613
614 def test_verify_bugs_and_answers_links(self):
615 # Verify the links for bugs and answers point to locations that
616 # exist.
617 html = self.view()
618 expected_base = '/%s/+source/%s' % (
619 self.spph.distroseries.distribution.name,
620 self.spph.source_package_name)
621 self.assertIn('<a href="%s/+bugs">' % expected_base, html)
622 self.assertIn('<a href="%s/+questions">' % expected_base, html)
608623
609class TestPersonPPAPackagesView(TestCaseWithFactory):624class TestPersonPPAPackagesView(TestCaseWithFactory):
610 """Test the maintained packages view."""625 """Test the maintained packages view."""
611626
=== modified file 'lib/lp/registry/templates/person-macros.pt'
--- lib/lp/registry/templates/person-macros.pt 2011-02-01 19:16:43 +0000
+++ lib/lp/registry/templates/person-macros.pt 2011-07-14 07:11:13 +0000
@@ -173,7 +173,7 @@
173 </a>173 </a>
174 </td>174 </td>
175 <td style="text-align: right">175 <td style="text-align: right">
176 <a tal:attributes="href string:${spr/sourcepackage/fmt:url}/+questions"176 <a tal:attributes="href string:${spr/distrosourcepackage/fmt:url}/+questions"
177 tal:content="spr/open_questions">177 tal:content="spr/open_questions">
178 </a>178 </a>
179 </td>179 </td>