Merge lp:~jcsackett/launchpad/kill-uses-launchpad-for-650648 into lp:launchpad

Proposed by j.c.sackett
Status: Merged
Approved by: Curtis Hovey
Approved revision: no longer in the source branch.
Merged at revision: 11675
Proposed branch: lp:~jcsackett/launchpad/kill-uses-launchpad-for-650648
Merge into: lp:launchpad
Diff against target: 683 lines (+66/-424)
10 files modified
lib/lp/registry/browser/distribution.py (+1/-38)
lib/lp/registry/browser/product.py (+1/-2)
lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt (+8/-33)
lib/lp/registry/stories/product/xx-product-launchpad-usage.txt (+0/-223)
lib/lp/registry/templates/distribution-details.pt (+0/-11)
lib/lp/registry/templates/product-index.pt (+0/-11)
lib/lp/translations/stories/project/xx-project-translations.txt (+52/-67)
lib/lp/translations/stories/standalone/xx-product-translations.txt (+1/-7)
lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt (+3/-9)
lib/lp/translations/stories/translationgroups/15-product-translation-group.txt (+0/-23)
To merge this branch: bzr merge lp:~jcsackett/launchpad/kill-uses-launchpad-for-650648
Reviewer Review Type Date Requested Status
Curtis Hovey (community) ui/code Approve
Review via email: mp+37252@code.launchpad.net

Commit message

Removes the Uses Launchpad for data in the product and distribution overview pages; this information is redundant.

Description of the change

Summary
=======

Removes the "Uses Launchpad for" section on product and distribution, which is superseded by the involvement menu.

Proposed Fix
============

Remove the section in the templates that displays the "Uses Launchpad for" as well as the UsesLaunchpadMixin used by the Views to determine what to display.

Pre-Implementation Talk
=======================

Spoke with Curtis.

Implementation details
======================

Largely as in proposed.

Removing the code/template section required updating the tests; in some cases rather than showing the positive condition "Translations is enabled," the only path that conformed to the story structure was instead to show the negative "Translations isn't in the disabled list." In other cases it seemed to make more sense to just remove the section of the test checking what usage showed, since it had more to do with manipulating controls. Comments on the stories are invited--I'm not certain it was the best approach.

Tests
=====

Demo and Q/A
============

The "Uses Launchpad for: " section on product/distros should be gone on all pages.

Lint
====

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/registry/browser/distribution.py
  lib/lp/registry/browser/product.py
  lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt
  lib/lp/registry/stories/product/xx-product-launchpad-usage.txt
  lib/lp/registry/templates/distribution-details.pt
  lib/lp/registry/templates/product-index.pt
  lib/lp/translations/stories/project/xx-project-translations.txt
  lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt
  lib/lp/translations/stories/translationgroups/15-product-translation-group.txt

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Hi Jon.

We talked in IRC. we both agreed that xx-product-launchpad-usage.txt may have lost its raison d'etra. We see lame tests for Product+edit, but +edit has not been used to configure applications for 6 months. We may want to delete the whole test since we know the form is well tested. We only want to keep this test if it explains why a project owner will enable or disable an application to enable/disable Involvement menu links. There is certainly more to delete.

review: Approve (ui/code)
Revision history for this message
j.c.sackett (jcsackett) wrote :

After some investigation, the only involvement things in the test in question were put there by me as a lame attempt to verify some steps taken in the test. It really has no reason to exist, so I have deleted it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/browser/distribution.py'
2--- lib/lp/registry/browser/distribution.py 2010-09-27 19:32:57 +0000
3+++ lib/lp/registry/browser/distribution.py 2010-10-04 14:52:48 +0000
4@@ -33,7 +33,6 @@
5 'DistributionSpecificationsMenu',
6 'DistributionUnofficialMirrorsView',
7 'DistributionView',
8- 'UsesLaunchpadMixin',
9 ]
10
11 import datetime
12@@ -70,13 +69,11 @@
13 from canonical.launchpad.webapp.breadcrumb import Breadcrumb
14 from canonical.launchpad.webapp.interfaces import ILaunchBag
15 from canonical.widgets.image import ImageChangeWidget
16-from lp.app.enums import service_uses_launchpad
17 from lp.answers.browser.faqtarget import FAQTargetNavigationMixin
18 from lp.answers.browser.questiontarget import (
19 QuestionTargetFacetMixin,
20 QuestionTargetTraversalMixin,
21 )
22-from lp.app.enums import ServiceUsage
23 from lp.app.errors import NotFoundError
24 from lp.blueprints.browser.specificationtarget import (
25 HasSpecificationsMenuMixin,
26@@ -103,7 +100,6 @@
27 MirrorContent,
28 MirrorSpeed,
29 )
30-from lp.registry.interfaces.product import IProduct
31 from lp.registry.interfaces.series import SeriesStatus
32 from lp.services.geoip.helpers import (
33 ipaddress_from_request,
34@@ -115,39 +111,6 @@
35 from lp.soyuz.interfaces.archive import IArchiveSet
36
37
38-class UsesLaunchpadMixin:
39- """This mixin is used for the overview page of products and distros."""
40-
41- @property
42- def uses_launchpad_for(self):
43- """Return a string of LP apps (comma-separated) this distro uses."""
44- uses = []
45- href_template = """<a href="%s">%s</a>"""
46- if service_uses_launchpad(self.context.answers_usage):
47- url = canonical_url(self.context, rootsite='answers')
48- uses.append(href_template % (url, 'Answers'))
49- if service_uses_launchpad(self.context.blueprints_usage):
50- url = canonical_url(self.context, rootsite='blueprints')
51- uses.append(href_template % (url, 'Blueprints'))
52- if self.context.official_malone:
53- url = canonical_url(self.context, rootsite='bugs')
54- uses.append(href_template % (url, 'Bug Tracking'))
55- if IProduct.providedBy(self.context):
56- if self.context.codehosting_usage == ServiceUsage.LAUNCHPAD:
57- url = canonical_url(self.context, rootsite='code')
58- uses.append(href_template % (url, 'Branches'))
59- if service_uses_launchpad(self.context.translations_usage):
60- url = canonical_url(self.context, rootsite='translations')
61- uses.append(href_template % (url, 'Translations'))
62-
63- if len(uses) == 0:
64- text = None
65- else:
66- text = english_list(uses)
67-
68- return text
69-
70-
71 class DistributionNavigation(
72 GetitemNavigation, BugTargetTraversalMixin, QuestionTargetTraversalMixin,
73 FAQTargetNavigationMixin, StructuralSubscriptionTargetTraversalMixin):
74@@ -626,7 +589,7 @@
75 return self.has_exact_matches
76
77
78-class DistributionView(HasAnnouncementsView, FeedsMixin, UsesLaunchpadMixin):
79+class DistributionView(HasAnnouncementsView, FeedsMixin):
80 """Default Distribution view class."""
81
82 def linkedMilestonesForSeries(self, series):
83
84=== modified file 'lib/lp/registry/browser/product.py'
85--- lib/lp/registry/browser/product.py 2010-09-28 20:57:34 +0000
86+++ lib/lp/registry/browser/product.py 2010-10-04 14:52:48 +0000
87@@ -158,7 +158,6 @@
88 from lp.registry.browser import BaseRdfView
89 from lp.registry.browser.announcement import HasAnnouncementsView
90 from lp.registry.browser.branding import BrandingChangeView
91-from lp.registry.browser.distribution import UsesLaunchpadMixin
92 from lp.registry.browser.menu import (
93 IRegistryCollectionNavigationMenu,
94 RegistryCollectionActionMenuBase,
95@@ -959,7 +958,7 @@
96
97
98 class ProductView(HasAnnouncementsView, SortSeriesMixin, FeedsMixin,
99- ProductDownloadFileMixin, UsesLaunchpadMixin):
100+ ProductDownloadFileMixin):
101
102 implements(IProductActionMenu, IEditableContextTitle)
103
104
105=== modified file 'lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt'
106--- lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt 2009-09-18 15:24:30 +0000
107+++ lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt 2010-10-04 14:52:48 +0000
108@@ -1,12 +1,8 @@
109-= Distribution Launchpad usage =
110-
111-The distribution overview page indicates for what usage the
112-distribution officially uses Launchpad.
113-
114- >>> anon_browser.open('http://launchpad.dev/ubuntu')
115- >>> print extract_text(find_tag_by_id(anon_browser.contents, 'uses'))
116- Uses Launchpad for:
117- Answers, Blueprints, Bug Tracking, and Translations.
118+Distribution Launchpad usage
119+============================
120+
121+The distribution overview page has links to allow you to configure which
122+services use Launchpad.
123
124 Unprivileged Launchpad users cannot access the page for changing these
125 details.
126@@ -43,9 +39,6 @@
127 >>> registrant.getControl(name='field.official_rosetta').value = False
128 >>> registrant.getControl('Change', index=3).click()
129
130- >>> print extract_text(find_tag_by_id(registrant.contents, 'uses'))
131- Uses Launchpad for: Answers, Blueprints, and Bug Tracking.
132-
133 Just like Launchpad administrators can.
134
135 >>> admin_browser.open('http://launchpad.dev/ubuntu')
136@@ -74,11 +67,9 @@
137
138 >>> print admin_browser.url
139 http://launchpad.dev/ubuntu
140- >>> print extract_text(find_tag_by_id(admin_browser.contents, 'uses'))
141- Does not use Launchpad for development.
142-
143-
144-== enable_bug_expiration and JavaScript ==
145+
146+enable_bug_expiration and JavaScript
147+====================================
148
149 JavaScript is used to constrain enable_bug_expiration to distributions
150 that use Launchpad to track bugs. If the form is submitted before the
151@@ -97,9 +88,6 @@
152
153 >>> content = find_main_content(admin_browser.contents)
154
155- >>> print extract_text(find_tag_by_id(admin_browser.contents, 'uses'))
156- Uses Launchpad for: Bug Tracking.
157-
158 Foo Bar chooses to switch the bug tracker again, but this time he
159 does not change the expiration check box, and he does the whole
160 operation before the page complete loading.
161@@ -116,16 +104,3 @@
162 >>> admin_browser.getControl('Change', index=3).click()
163
164 >>> content = find_main_content(admin_browser.contents)
165- >>> print extract_text(find_tag_by_id(admin_browser.contents, 'uses'))
166- Does not use Launchpad for development.
167-
168-Returning to the edit page, Foo Bar can see that bug expiration was
169-also disabled.
170-
171- >>> admin_browser.getLink('Change details').click()
172- >>> print admin_browser.getControl(name='field.official_malone').value
173- False
174-
175- >>> print admin_browser.getControl(
176- ... name='field.enable_bug_expiration').value
177- False
178
179=== removed file 'lib/lp/registry/stories/product/xx-product-launchpad-usage.txt'
180--- lib/lp/registry/stories/product/xx-product-launchpad-usage.txt 2010-08-31 14:28:04 +0000
181+++ lib/lp/registry/stories/product/xx-product-launchpad-usage.txt 1970-01-01 00:00:00 +0000
182@@ -1,223 +0,0 @@
183-Product Launchpad usage
184-=======================
185-
186-The launchpad usage flags (whether the product uses Bugs, Answers or
187-Translations officially) are found on the +edit page.
188-
189- >>> anon_browser.open('http://launchpad.dev/firefox')
190- >>> print anon_browser.title
191- Mozilla Firefox in Launchpad
192-
193- >>> uses = find_tag_by_id(anon_browser.contents, id='uses')
194- >>> print extract_text(uses)
195- Uses Launchpad for: Answers and Bug Tracking.
196-
197-Only the product registrant and the admins have access to this page.
198-
199- >>> anon_browser.getLink('Change details')
200- Traceback (most recent call last):
201- ...
202- LinkNotFound...
203- >>> anon_browser.open('http://launchpad.dev/ubuntu/+edit')
204- Traceback (most recent call last):
205- ...
206- Unauthorized...
207-
208-Let's use Sample Person, the registrant of Firefox..
209-
210- >>> from lp.testing.sampledata import SAMPLE_PERSON_EMAIL
211- >>> registrant_browser = setupBrowser(
212- ... auth='Basic %(email)s:%(passwd)s' % dict(
213- ... email=SAMPLE_PERSON_EMAIL, passwd='test'))
214- >>> registrant_browser.open('http://launchpad.dev/firefox')
215- >>> registrant_browser.getLink('Configure bug tracker').click()
216- >>> registrant_browser.url
217- 'http://launchpad.dev/firefox/+configure-bugtracker'
218-
219-Firefox is currently marked as using Bugs. Let's specify that it
220-doesn't use any bug tracker at all.
221-
222- >>> registrant_browser.getControl(
223- ... 'In Launchpad').selected
224- True
225- >>> registrant_browser.getControl(
226- ... 'Expire "Incomplete" bug reports when they '
227- ... 'become inactive').selected
228- False
229- >>> registrant_browser.getControl('Somewhere else').selected = True
230- >>> registrant_browser.getControl('Change').click()
231-
232-We'll also set up a development focus branch. Because it's a mirrored
233-branch, codehosting won't show up as a service the product uses.
234-
235- >>> registrant_browser.getLink('Configure project branch').click()
236- >>> registrant_browser.getControl(name='field.branch_location').value = (
237- ... '~name12/firefox/main')
238- >>> registrant_browser.getControl('Update').click()
239-
240-Translations can be enabled.
241-
242- >>> registrant_browser.open('http://launchpad.dev/firefox')
243- >>> registrant_browser.getLink('Configure translations').click()
244- >>> registrant_browser.url
245- 'http://launchpad.dev/firefox/+configure-translations'
246- >>> print_radio_button_field(registrant_browser.contents,
247- ... "translations_usage")
248- (*) Unknown
249- ( ) Launchpad
250- ( ) External
251- ( ) Not Applicable
252-
253- >>> registrant_browser.getControl('Launchpad').click()
254- >>> registrant_browser.getControl('Change').click()
255-
256-Answers can be disabled.
257-
258- >>> registrant_browser.open('http://launchpad.dev/firefox')
259- >>> registrant_browser.getLink('Configure support tracker').click()
260- >>> registrant_browser.url
261- 'http://launchpad.dev/firefox/+configure-answers'
262- >>> print_radio_button_field(registrant_browser.contents, "answers_usage")
263- ( ) Unknown
264- (*) Launchpad
265- ( ) External
266- ( ) Not Applicable
267- >>> registrant_browser.getControl('Unknown').click()
268- >>> registrant_browser.getControl('Change').click()
269-
270-On the product page, we can see that the product doesn't use any bug
271-tracker, not even Launchpad.
272-
273- >>> uses = find_tag_by_id(registrant_browser.contents, id='uses')
274- >>> print extract_text(uses)
275- Uses Launchpad for: Translations.
276-
277-Blueprints can be enabled too, though it isn't easy.
278-
279- >>> # First go to the Blueprints page.
280- >>> registrant_browser.open('http://launchpad.dev/firefox')
281- >>> registrant_browser.getLink('Blueprints').click()
282- >>> registrant_browser.getLink('Configure blueprints').click()
283- >>> registrant_browser.url
284- 'http://blueprints.launchpad.dev/firefox/+configure-blueprints'
285- >>> print_radio_button_field(registrant_browser.contents,
286- ... "blueprints_usage")
287- (*) Unknown
288- ( ) Launchpad
289- ( ) External
290- ( ) Not Applicable
291- >>> registrant_browser.getControl('Launchpad').click()
292- >>> registrant_browser.getControl('Change').click()
293-
294-
295-On the product page, we can see that the product doesn't use any bug
296-tracker, not even Launchpad, but does use Translations.
297-
298- >>> registrant_browser.open('http://launchpad.dev/firefox')
299- >>> uses = find_tag_by_id(registrant_browser.contents, id='uses')
300- >>> print extract_text(uses)
301- Uses Launchpad for: Blueprints and Translations.
302-
303-Setting a usage to external is reflected in the "Uses" message.
304-Change translations to external.
305-
306- >>> registrant_browser.open('http://launchpad.dev/firefox')
307- >>> registrant_browser.getLink('Configure translations').click()
308- >>> registrant_browser.getControl('External').click()
309- >>> registrant_browser.getControl('Change').click()
310-
311- >>> uses = find_tag_by_id(registrant_browser.contents, id='uses')
312- >>> print extract_text(uses)
313- Uses Launchpad for: Blueprints.
314-
315-
316-Tracking bugs by email
317-----------------------
318-
319-Instead if using a web-based bug tracker, projects can specify an
320-email address where bug reports should be sent.
321-
322- >>> registrant_browser.open(
323- ... 'http://launchpad.dev/firefox/+configure-bugtracker')
324- >>> registrant_browser.getControl(
325- ... 'By emailing an upstream bug contact').selected = True
326- >>> registrant_browser.getControl(
327- ... name='field.bugtracker.upstream_email_address').value = (
328- ... 'puff@magicdragon.example.com')
329- >>> registrant_browser.getControl('Change').click()
330-
331-An Email Address bug tracker is automatically created.
332-
333- >>> registrant_browser.open('http://launchpad.dev/bugs/bugtrackers')
334- >>> registrant_browser.getLink(
335- ... "Email to puff@magicdragon").click()
336- >>> print extract_text(
337- ... find_tag_by_id(registrant_browser.contents, 'bugtracker-urls'))
338- mailto:puff@magicdragon.example.com
339-
340-An error message is shown if the email address is not filled in.
341-
342- >>> registrant_browser.open(
343- ... 'http://launchpad.dev/firefox/+configure-bugtracker')
344- >>> registrant_browser.getControl(
345- ... 'By emailing an upstream bug contact').selected = True
346- >>> registrant_browser.getControl(
347- ... name='field.bugtracker.upstream_email_address').value = ''
348- >>> registrant_browser.getControl('Change').click()
349- >>> registrant_browser.url
350- 'http://launchpad.dev/firefox/+configure-bugtracker'
351- >>> for message in find_tags_by_class(
352- ... registrant_browser.contents, 'message'):
353- ... print extract_text(message)
354- There is 1 error.
355- Please enter an email address.
356-
357-
358-enable_bug_expiration and JavaScript
359-------------------------------------
360-
361-JavaScript is used to constrain enable_bug_expiration to projects that
362-use Launchpad to track bugs. If the form is submitted before the page
363-has loaded, the enable_bug_expiration will not be disabled by the
364-JavaScript function. The constraint is enforced by the view class--the
365-data is corrected instead of returning a error to the user.
366-
367-Jokosher uses Launchpad to track bugs and it has bug expiration enabled.
368-Dafydd, the project registrant, switches the bug tracker to 'Somewhere
369-else' before the page can complete loading. (TestBrowser does not
370-support JavaScript so this behaviour is easy to simulate.)
371-
372- >>> registrant_browser = setupBrowser(auth='Basic daf@canonical.com:daf')
373- >>> registrant_browser.open('http://launchpad.dev/jokosher')
374- >>> registrant_browser.title
375- 'Jokosher Audio Editor in Launchpad'
376-
377- >>> registrant_browser.getLink('Configure bug tracker').click()
378- >>> registrant_browser.getControl('In Launchpad').selected
379- True
380-
381- >>> registrant_browser.getControl(
382- ... 'Expire "Incomplete" bug reports when they '
383- ... 'become inactive').selected
384- True
385-
386- >>> registrant_browser.getControl('Somewhere else').selected = True
387- >>> registrant_browser.getControl('Change').click()
388-
389-The Status of Launchpad uses shows the bug tracker was changed.
390-
391- >>> uses = find_tag_by_id(registrant_browser.contents, id='uses')
392- >>> print extract_text(uses)
393- Does not use Launchpad for development.
394-
395-Reviewing the edit page again, Dafydd, can see that bug expiration was
396-also disabled by the switch from Launchpad Bugs.
397-
398- >>> registrant_browser.getLink('Configure bug tracker').click()
399- >>> registrant_browser.getControl('In Launchpad').selected
400- False
401-
402- >>> registrant_browser.getControl(
403- ... 'Expire "Incomplete" bug reports when they '
404- ... 'become inactive').selected
405- False
406
407=== modified file 'lib/lp/registry/templates/distribution-details.pt'
408--- lib/lp/registry/templates/distribution-details.pt 2009-09-17 12:02:37 +0000
409+++ lib/lp/registry/templates/distribution-details.pt 2010-10-04 14:52:48 +0000
410@@ -70,17 +70,6 @@
411 </dl>
412 </div>
413
414- <dl id="uses" tal:define="uses_launchpad view/uses_launchpad_for">
415- <tal:uses_launchpad condition="uses_launchpad">
416- <dt>Uses Launchpad for:</dt>
417- <dd><tal:uses content="structure uses_launchpad" />.</dd>
418- </tal:uses_launchpad>
419- <tal:no_launchpad condition="not: uses_launchpad">
420- <dt>Does not use Launchpad for development.</dt>
421- <dd></dd>
422- </tal:no_launchpad>
423- </dl>
424-
425 <dl id="uploaders" style="clear:left">
426 <dt>Uploaders:</dt>
427
428
429=== modified file 'lib/lp/registry/templates/product-index.pt'
430--- lib/lp/registry/templates/product-index.pt 2010-09-03 13:32:42 +0000
431+++ lib/lp/registry/templates/product-index.pt 2010-10-04 14:52:48 +0000
432@@ -96,17 +96,6 @@
433 </dd>
434 </dl>
435
436- <dl id="uses" tal:define="uses_launchpad view/uses_launchpad_for">
437- <tal:uses_launchpad condition="uses_launchpad">
438- <dt>Uses Launchpad for:</dt>
439- <dd><tal:uses content="structure uses_launchpad" />.</dd>
440- </tal:uses_launchpad>
441- <tal:no_launchpad condition="not: uses_launchpad">
442- <dt>Does not use Launchpad for development.</dt>
443- <dd></dd>
444- </tal:no_launchpad>
445- </dl>
446-
447 <dl id="dev-focus"
448 tal:define="dev_focus context/development_focus;
449 trunk dev_focus/branch;
450
451=== modified file 'lib/lp/translations/stories/project/xx-project-translations.txt'
452--- lib/lp/translations/stories/project/xx-project-translations.txt 2010-02-17 11:13:06 +0000
453+++ lib/lp/translations/stories/project/xx-project-translations.txt 2010-10-04 14:52:48 +0000
454@@ -3,100 +3,85 @@
455
456 GNOME is a good example, it has products with translations.
457
458- >>> browser.open('http://translations.launchpad.dev/gnome')
459- >>> print browser.url
460- http://translations.launchpad.dev/gnome
461+ >>> browser.open('http://translations.launchpad.dev/gnome')
462+ >>> print browser.url
463+ http://translations.launchpad.dev/gnome
464
465 Evolution being one with translations and being used officially
466
467- >>> evo_link = browser.getLink('Evolution')
468- >>> print evo_link.url
469- http://launchpad.dev/evolution/+translations
470+ >>> evo_link = browser.getLink('Evolution')
471+ >>> print evo_link.url
472+ http://launchpad.dev/evolution/+translations
473
474- >>> browser.open('http://translations.launchpad.dev/gnome')
475- >>> print browser.url
476- http://translations.launchpad.dev/gnome
477+ >>> browser.open('http://translations.launchpad.dev/gnome')
478+ >>> print browser.url
479+ http://translations.launchpad.dev/gnome
480
481 Netapplet is another product of GNOME project. It has translations,
482 but it's not using Launchpad officially, so it's not listed among
483 translatable projects.
484
485- >>> translated_projects = find_tag_by_id(
486- ... browser.contents, 'translatable-projects')
487- >>> link = translated_projects.find(text='Network Applet')
488- >>> print link
489- None
490+ >>> translated_projects = find_tag_by_id(
491+ ... browser.contents, 'translatable-projects')
492+ >>> link = translated_projects.find(text='Network Applet')
493+ >>> print link
494+ None
495
496 It does show up among untranslated projects.
497
498- >>> untranslated_projects = find_tag_by_id(
499- ... browser.contents, 'untranslatable-projects')
500- >>> link = untranslated_projects.find(text='NetApplet').parent
501- >>> link['href']
502- u'http://launchpad.dev/netapplet/+translations'
503+ >>> untranslated_projects = find_tag_by_id(
504+ ... browser.contents, 'untranslatable-projects')
505+ >>> link = untranslated_projects.find(text='NetApplet').parent
506+ >>> link['href']
507+ u'http://launchpad.dev/netapplet/+translations'
508
509 Let's confirm what we just stated.
510
511- >>> anon_browser.open('http://launchpad.dev/gnome')
512- >>> anon_browser.getLink('NetApplet').click()
513- >>> print anon_browser.title
514- Network Applet in Launchpad
515-
516-It's not using Launchpad Translations officially
517-
518- >>> uses = find_tag_by_id(anon_browser.contents, 'uses')
519- >>> print extract_text(uses)
520- Does not use Launchpad for development.
521+ >>> anon_browser.open('http://launchpad.dev/gnome')
522+ >>> anon_browser.getLink('NetApplet').click()
523+ >>> print anon_browser.title
524+ Network Applet in Launchpad
525
526 Anonymous users don't see the translations
527
528- >>> anon_browser.getLink('Translations').click()
529- >>> print anon_browser.title
530- Translations : NetApplet
531+ >>> anon_browser.getLink('Translations').click()
532+ >>> print anon_browser.title
533+ Translations : NetApplet
534
535- >>> find_tag_by_id(
536- ... anon_browser.contents,
537- ... 'portlet-obsolete-translatable-series') is None
538- True
539+ >>> find_tag_by_id(
540+ ... anon_browser.contents,
541+ ... 'portlet-obsolete-translatable-series') is None
542+ True
543
544 alsa-utils is a product that doesn't belong to GNOME project. It has
545 translations and is using Launchpad Translations officially, and it
546 shouldn't appear in GNOME project translations page.
547
548- >>> browser.open('http://translations.launchpad.dev/gnome')
549- >>> browser.getLink('alsa-utils')
550- Traceback (most recent call last):
551- ...
552- LinkNotFoundError
553+ >>> browser.open('http://translations.launchpad.dev/gnome')
554+ >>> browser.getLink('alsa-utils')
555+ Traceback (most recent call last):
556+ ...
557+ LinkNotFoundError
558
559 Let's confirm what we just stated.
560
561- >>> browser.open('http://launchpad.dev/gnome')
562- >>> print browser.url
563- http://launchpad.dev/gnome
564+ >>> browser.open('http://launchpad.dev/gnome')
565+ >>> print browser.url
566+ http://launchpad.dev/gnome
567
568 alsa-utils does not belong to GNOME project.
569
570- >>> browser.getLink('alsa-utils')
571- Traceback (most recent call last):
572- ...
573- LinkNotFoundError
574-
575-It's using Launchpad Translations officially.
576-
577- >>> browser.open('http://launchpad.dev/alsa-utils')
578- >>> print browser.url
579- http://launchpad.dev/alsa-utils
580- >>> uses = find_tag_by_id(browser.contents, 'uses')
581- >>> print extract_text(uses)
582- Uses Launchpad for: Translations.
583-
584-And it has translations.
585-
586- >>> browser.open('http://translations.launchpad.dev/alsa-utils')
587- >>> print browser.url
588- http://translations.launchpad.dev/alsa-utils
589-
590- >>> alsa_utils_spanish = browser.getLink('Spanish')
591- >>> print alsa_utils_spanish.url
592- http://translations.../alsa-utils/trunk/+pots/alsa-utils/es/+translate
593+ >>> browser.getLink('alsa-utils')
594+ Traceback (most recent call last):
595+ ...
596+ LinkNotFoundError
597+
598+It's using Launchpad Translations officially. And it has translations.
599+
600+ >>> browser.open('http://translations.launchpad.dev/alsa-utils')
601+ >>> print browser.url
602+ http://translations.launchpad.dev/alsa-utils
603+
604+ >>> alsa_utils_spanish = browser.getLink('Spanish')
605+ >>> print alsa_utils_spanish.url
606+ http://translations.../alsa-utils/trunk/+pots/alsa-utils/es/+translate
607
608=== modified file 'lib/lp/translations/stories/standalone/xx-product-translations.txt'
609--- lib/lp/translations/stories/standalone/xx-product-translations.txt 2010-09-27 19:33:04 +0000
610+++ lib/lp/translations/stories/standalone/xx-product-translations.txt 2010-10-04 14:52:48 +0000
611@@ -121,15 +121,9 @@
612 gnomebaker translates its messages.
613
614 Finally, if a product states that is not officially using Launchpad
615-Translations...
616+Translations it doesn't show any translation template:
617
618 >>> anon_browser.open('http://launchpad.dev/netapplet')
619- >>> content = find_tag_by_id(anon_browser.contents, 'uses')
620- >>> print extract_text(content)
621- Does not use Launchpad for development.
622-
623-... it doesn't show any translation template:
624-
625 >>> anon_browser.getLink('Translations').click()
626 >>> print anon_browser.title
627 Translations : NetApplet
628
629=== modified file 'lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt'
630--- lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt 2009-09-18 15:42:19 +0000
631+++ lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt 2010-10-04 14:52:48 +0000
632@@ -1,15 +1,9 @@
633 Now, let's go have a look at where we can use these translation groups.
634 We want to check out the distro side first.
635
636-Ubuntu is using Launchpad for translations
637-
638- >>> anon_browser.open('http://launchpad.dev/ubuntu')
639- >>> print extract_text(
640- ... find_tag_by_id(anon_browser.contents, 'uses'))
641- Uses Launchpad for: ... Translations.
642-
643-Ubuntu doesn't have TranslationGroup and uses open permissions. We can
644-see that from the translations page.
645+Ubuntu is using Launchpad for translations. Ubuntu doesn't have
646+TranslationGroup and uses open permissions. We can see that from the
647+translations page.
648
649 >>> anon_browser.getLink('Translations').click()
650 >>> print anon_browser.title
651
652=== modified file 'lib/lp/translations/stories/translationgroups/15-product-translation-group.txt'
653--- lib/lp/translations/stories/translationgroups/15-product-translation-group.txt 2010-09-26 21:49:27 +0000
654+++ lib/lp/translations/stories/translationgroups/15-product-translation-group.txt 2010-10-04 14:52:48 +0000
655@@ -1,29 +1,6 @@
656 We should also be able to set a translation group and translation
657 permissions on a product. We'll use the Netapplet product for this test.
658
659-First make sure it uses Launchpad for translations.
660-
661- >>> netapplet_owner_browser = setupBrowser(
662- ... auth='Basic test@canonical.com:test')
663- >>> netapplet_owner_browser.open('http://launchpad.dev/netapplet')
664- >>> print extract_text(
665- ... find_tag_by_id(netapplet_owner_browser.contents, 'uses'))
666- Does not use Launchpad for development.
667-
668- >>> netapplet_owner_browser.getLink(
669- ... 'Configure translations').click()
670- >>> print netapplet_owner_browser.title
671- Configure Translations : NetApplet
672-
673- >>> netapplet_owner_browser.getControl('Launchpad').click()
674- >>> netapplet_owner_browser.getControl('Change').click()
675- >>> print netapplet_owner_browser.title
676- Network Applet in Launchpad
677-
678- >>> print extract_text(
679- ... find_tag_by_id(netapplet_owner_browser.contents, 'uses'))
680- Uses Launchpad for: Translations.
681-
682 Netapplet doesn't have TranslationGroup and uses open permissions. We
683 can see that from the translations page.
684