=== modified file 'lib/canonical/launchpad/security.py'
--- lib/canonical/launchpad/security.py 2009-12-18 13:25:19 +0000
+++ lib/canonical/launchpad/security.py 2009-12-21 15:17:16 +0000
@@ -1678,7 +1678,7 @@
def checkAuthenticated(self, user):
"""Is the user able to manage `IDistroSeries` translations.
- Disribution managers can also manage IDistroSeries
+ Distribution managers can also manage IDistroSeries
"""
return (AdminDistributionTranslations( self.obj.distribution).checkAuthenticated(user))
@@ -1691,7 +1691,7 @@
def checkAuthenticated(self, user):
"""Is the user able to manage `IDistroSeriesLanguage` translations.
- Disribution managers can also manage IDistroSeriesLanguage
+ Distribution managers can also manage IDistroSeriesLanguage
"""
return (AdminDistroSeriesTranslations( self.obj.distroseries).checkAuthenticated(user))
...a notice about the fact shows up on the overview page.
>>> notices = find_tags_by_class(
- ... utc_browser.contents, 'visibility-notice')
+ ... dtc_browser.contents, 'visibility-notice')
>>> for notice in notices:
... print extract_text(notice)
Translations for this series are currently hidden.
@@ -92,7 +92,7 @@
Translations administrator have access series with hidden translations.
Non existing languages are not viewable. English is a special case
@@ -124,7 +124,7 @@
However, source package translations are still available to the
administrators.
@@ -132,21 +132,21 @@
distribution should be deferred. That option is set also from the same
form where we hide all translations and an admin is able to change it:
Here is the latest diff.
Many thanks for the review!
=== modified file 'lib/canonical/ launchpad/ security. py' launchpad/ security. py 2009-12-18 13:25:19 +0000 launchpad/ security. py 2009-12-21 15:17:16 +0000 ted(self, user):
--- lib/canonical/
+++ lib/canonical/
@@ -1678,7 +1678,7 @@
def checkAuthentica
"""Is the user able to manage `IDistroSeries` translations.
- Disribution managers can also manage IDistroSeries ionTranslations (
self. obj.distributio n).checkAuthent icated( user)) ted(self, user): anguage` translations.
+ Distribution managers can also manage IDistroSeries
"""
return (AdminDistribut
@@ -1691,7 +1691,7 @@
def checkAuthentica
"""Is the user able to manage `IDistroSeriesL
- Disribution managers can also manage IDistroSeriesLa nguage nguage iesTranslations (
self. obj.distroserie s).checkAuthent icated( user))
+ Distribution managers can also manage IDistroSeriesLa
"""
return (AdminDistroSer
=== modified file 'lib/canonical/ launchpad/ testing/ pages.py' launchpad/ testing/ pages.py 2009-12-18 13:25:19 +0000 launchpad/ testing/ pages.py 2009-12-21 17:17:46 +0000 testing. webservice import WebServiceCaller Factory interfaces. person import NameAlreadyTaken
--- lib/canonical/
+++ lib/canonical/
@@ -39,6 +39,7 @@
from lazr.restful.
from lp.testing import ANONYMOUS, login, login_person, logout
from lp.testing.factory import LaunchpadObject
+from lp.registry.
class UnstickyCookieH TTPCaller( HTTPCaller) : viceCaller( consumer_ key, access_token.key)
@@ -636,17 +637,24 @@
return LaunchpadWebSer
-def setupUTCBrowser():
- """Testbrowser configured for Ubuntu Translations Coordinators."""
+def setupDTCBrowser():
+ """Testbrowser configured for Distribution Translations Coordinators.
+ Ubuntu is the configured distribution. Factory( ).makePerson( Factory( ).makeTranslati onGroup( owner=utg_ member) ILaunchpadCeleb rities) .ubuntu translationgrou p = utg Factory( ).makePerson( Factory( ).makeTranslati onGroup( owner=dtg_ member) ILaunchpadCeleb rities) .ubuntu translationgrou p = dtg auth='Basic <email address hidden>:test') auth='Basic <email address hidden>:test')
+ """
login('<email address hidden>')
- utg_member = LaunchpadObject
- <email address hidden>", password="test")
- utg = LaunchpadObject
- ubuntu = getUtility(
- ubuntu.
+ try:
+ dtg_member = LaunchpadObject
+ <email address hidden>", password="test")
+ except NameAlreadyTaken:
+ # We have already created the translations coordinator
+ pass
+ else:
+ dtg = LaunchpadObject
+ ubuntu = getUtility(
+ ubuntu.
logout()
- return setupBrowser(
+ return setupBrowser(
def stop(): globs[' user_webservice '] = LaunchpadWebSer viceCaller(
'launchpad- library' , 'nopriv- read-nonprivate ') globs[' setupBrowser' ] = setupBrowser 'setupUTCBrowse r'] = setupUTCBrowser 'setupDTCBrowse r'] = setupDTCBrowser globs[' browser' ] = setupBrowser() globs[' anon_browser' ] = setupBrowser() globs[' user_browser' ] = setupBrowser(
@@ -669,7 +677,7 @@
test.
test.
- test.globs[
+ test.globs[
test.
test.
test.
=== modified file 'lib/lp/ translations/ stories/ distroseries/ xx-distroseries -translations. txt' translations/ stories/ distroseries/ xx-distroseries -translations. txt 2009-12-18 13:25:19 +0000 translations/ stories/ distroseries/ xx-distroseries -translations. txt 2009-12-21 17:17:38 +0000
--- lib/lp/
+++ lib/lp/
@@ -45,24 +45,24 @@
... but the link is available to administrators:
- >>> utc_browser = setupUTCBrowser() translations. launchpad. dev/ubuntu/ hoary') getLink( 'Change settings').click() translations. launchpad. dev/ubuntu/ hoary') getLink( 'Change settings').click()
-
- >>> utc_browser.open('http://
-
- >>> utc_browser.
+ >>> dtc_browser = setupDTCBrowser()
+
+ >>> dtc_browser.open('http://
+
+ >>> dtc_browser.
Once the administrator hides all translations...
- >>> utc_browser. getControl( getControl( getControl( 'Change' ).click( ) getControl( 'Change' ).click( ) translations. launchpad. dev/ubuntu/ hoary
+ >>> dtc_browser.
... 'Hide translations for this release').selected = True
- >>> utc_browser.
- >>> print utc_browser.url
+ >>> dtc_browser.
+ >>> print dtc_browser.url
http://
...a notice about the fact shows up on the overview page.
>>> notices = find_tags_by_class( contents, 'visibility- notice' ) contents, 'visibility- notice' ) text(notice)
- ... utc_browser.
+ ... dtc_browser.
>>> for notice in notices:
... print extract_
Translations for this series are currently hidden.
@@ -92,7 +92,7 @@
Translations administrator have access series with hidden translations.
- >>> utc_browser.open( translations. launchpad. dev/ubuntu/ hoary/+ lang/es')
+ >>> dtc_browser.open(
... 'http://
Non existing languages are not viewable. English is a special case
@@ -124,7 +124,7 @@
However, source package translations are still available to the
administrators.
- >>> utc_browser.open( translations. launchpad. dev/ubuntu/ hoary/' evolution' )
+ >>> dtc_browser.open(
... 'http://
... '+sources/
@@ -132,21 +132,21 @@
distribution should be deferred. That option is set also from the same
form where we hide all translations and an admin is able to change it:
- >>> utc_browser.open('http:// translations. launchpad. dev/ubuntu/ hoary') getLink( 'Change settings').click() getControl( translations. launchpad. dev/ubuntu/ hoary') getLink( 'Change settings').click() getControl( getControl( getControl( getControl( 'Change' ).click( ) getControl( 'Change' ).click( ) translations. launchpad. dev/ubuntu/ hoary
- >>> utc_browser.
- >>> utc_browser.
+ >>> dtc_browser.open('http://
+ >>> dtc_browser.
+ >>> dtc_browser.
... 'Defer translation imports').selected
False
- >>> utc_browser.
+ >>> dtc_browser.
... 'Defer translation imports').selected = True
- >>> utc_browser.
- >>> print utc_browser.url
+ >>> dtc_browser.
+ >>> print dtc_browser.url
http://
Once the system accepts the submission, we can see such change applied.
- >>> utc_browser. getLink( 'Change settings').click() getControl( getLink( 'Change settings').click() getControl(
- >>> utc_browser.
+ >>> dtc_browser.
+ >>> dtc_browser.
... 'Defer translation imports').selected
True