launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #12027
[Merge] lp:~jcsackett/launchpad/get-loc-for-bugtracker-fix into lp:launchpad
j.c.sackett has proposed merging lp:~jcsackett/launchpad/get-loc-for-bugtracker-fix into lp:launchpad with lp:~jcsackett/launchpad/bug-tracker-inactive-projects as a prerequisite.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~jcsackett/launchpad/get-loc-for-bugtracker-fix/+merge/124528
Summary
=======
This branch gains LoC for a related bugfix by removing unnecessary doctest and
creating equivalent unit tests.
Implementation
==============
The doctest for the related project portlet is removed. There's not much worth
"documenting" and this was largely testing behavior. A unit test is added to
the bugtracker view test to ensure this behavior remains tested.
Tests
=====
bin/test -vvct test_bugtracker_view
QA
==
None
LoC
===
This removes LoC.
Lint
====
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/bugs/browser/tests/test_bugtracker_views.py
lib/lp/bugs/browser/bugtracker.py
lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt
--
https://code.launchpad.net/~jcsackett/launchpad/get-loc-for-bugtracker-fix/+merge/124528
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jcsackett/launchpad/get-loc-for-bugtracker-fix into lp:launchpad.
=== modified file 'lib/lp/bugs/browser/tests/test_bugtracker_views.py'
--- lib/lp/bugs/browser/tests/test_bugtracker_views.py 2012-09-14 21:44:35 +0000
+++ lib/lp/bugs/browser/tests/test_bugtracker_views.py 2012-09-14 21:44:35 +0000
@@ -24,7 +24,20 @@
layer = DatabaseFunctionalLayer
+ def test_related_projects(self):
+ # Related products and projectgroups are shown by the view.
+ tracker = self.factory.makeBugTracker()
+ project_group = self.factory.makeProject()
+ product = self.factory.makeProduct()
+ admin = getUtility(ILaunchpadCelebrities).admin.teamowner
+ with person_logged_in(admin):
+ project_group.bugtracker = tracker
+ product.bugtracker = tracker
+ view = create_initialized_view(tracker, name='+index')
+ self.assertEqual([project_group, product], view.related_projects)
+
def test_linked_projects_only_shows_active_projects(self):
+ # Inactive projects are not shown as the related projects.
tracker = self.factory.makeBugTracker()
active_product = self.factory.makeProduct()
inactive_product = self.factory.makeProduct()
=== modified file 'lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt'
--- lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt 2012-07-17 14:29:17 +0000
+++ lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt 2012-09-14 21:44:35 +0000
@@ -688,43 +688,6 @@
Copy, Cut and Delete operations should work on selections
--> —: None
-
-Related projects portlet
-------------------------
-
-Related projects and project groups are shown in a portlet on the bug
-tracker page.
-
-First we need to change a project group and a project to use our new bug
-tracker:
-
- >>> admin_browser.open('http://launchpad.dev/mozilla/+edit')
- >>> admin_browser.getControl('Bug Tracker:').value = 'testbugzilla'
- >>> admin_browser.getControl('Change Details').click()
-
- >>> admin_browser.open(
- ... 'http://launchpad.dev/jokosher/+configure-bugtracker')
- >>> admin_browser.getControl(name='field.bugtracker'
- ... ).displayValue = ['In a registered bug tracker:']
- >>> admin_browser.getControl(name='field.bugtracker.bugtracker'
- ... ).value = 'testbugzilla'
- >>> admin_browser.getControl('Change').click()
-
-Now the Mozilla Project and Jokosher will appear in the Related projects
-portlet on the bug tracker page:
-
- >>> admin_browser.open(
- ... 'http://launchpad.dev/bugs/bugtrackers/testbugzilla')
- >>> print extract_text(find_portlet(
- ... admin_browser.contents, 'Related projects'))
- Related projects
- You can link a registered project to a
- registered bug tracker in the project's “Change
- details” page.
- The Mozilla Project
- Jokosher
-
-
Info portlet
------------
Follow ups