launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #04267
[Merge] lp:~stevenk/launchpad/uploaded-packages-wrong-link into lp:launchpad
Steve Kowalik has proposed merging lp:~stevenk/launchpad/uploaded-packages-wrong-link into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #799308 in Launchpad itself: "+uploaded-packages links to series specific answers (but that does not exist)"
https://bugs.launchpad.net/launchpad/+bug/799308
For more details, see:
https://code.launchpad.net/~stevenk/launchpad/uploaded-packages-wrong-link/+merge/67916
Correct the link for Questions on ~/+uploaded-packages, and add a test for the bug and answers links, since I couldn't locate one.
--
https://code.launchpad.net/~stevenk/launchpad/uploaded-packages-wrong-link/+merge/67916
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/uploaded-packages-wrong-link into lp:launchpad.
=== 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 05:16:28 +0000
@@ -47,6 +47,7 @@
from lp.registry.model.milestone import milestone_sort_key
from lp.registry.model.person import Person
from lp.soyuz.enums import (
+ ArchivePurpose,
ArchiveStatus,
PackagePublishingStatus,
)
@@ -595,6 +596,11 @@
def setUp(self):
super(TestPersonUploadedPackagesView, self).setUp()
self.user = self.factory.makePerson()
+ archive = self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY)
+ spr = self.factory.makeSourcePackageRelease(
+ creator=self.user, archive=archive)
+ self.spph = self.factory.makeSourcePackagePublishingHistory(
+ sourcepackagerelease=spr, archive=archive)
self.view = create_initialized_view(self.user, '+uploaded-packages')
def test_view_helper_attributes(self):
@@ -605,6 +611,15 @@
config.launchpad.default_batch_size,
self.view.max_results_to_display)
+ def test_verify_bugs_and_answers_links(self):
+ # Verify the links for bugs and answers point to locations that
+ # exist.
+ html = self.view()
+ expected_base = '/%s/+source/%s/' % (
+ self.spph.distroseries.distribution.name,
+ self.spph.source_package_name)
+ for suffix in ('+bugs', '+questions'):
+ self.assertIn('<a href="%s%s">' % (expected_base, suffix), html)
class TestPersonPPAPackagesView(TestCaseWithFactory):
"""Test the maintained packages view."""
=== 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 05:16:28 +0000
@@ -173,7 +173,7 @@
</a>
</td>
<td style="text-align: right">
- <a tal:attributes="href string:${spr/sourcepackage/fmt:url}/+questions"
+ <a tal:attributes="href string:${spr/distrosourcepackage/fmt:url}/+questions"
tal:content="spr/open_questions">
</a>
</td>