~launchpad-pqm/launchpad/devel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Lastly, we should be able to set the translation group on a project.
We'll use the Gnome project as an example. First make sure we can see
the Gnome project page and that it has no translation group assigned.

    >>> gnome_owner_browser = setupBrowser(
    ...     auth='Basic test@canonical.com:test')
    >>> gnome_owner_browser.open('http://launchpad.dev/gnome')
    >>> gnome_owner_browser.getLink('Translations').click()
    >>> translations_page_url = gnome_owner_browser.url
    >>> print gnome_owner_browser.title
    Translations : GNOME

And now make sure we can see the form to change the translation group
and permissions on a project.

    >>> gnome_owner_browser.getLink('Change permissions').click()
    >>> print gnome_owner_browser.title
    Permissions and policies...

Other users don't see the "Change translators" link and aren't allowed
to access the page it leads to.

    >>> user_browser.open(translations_page_url)
    >>> user_browser.getLink('Change permissions').click()
    Traceback (most recent call last):
    ...
    LinkNotFoundError

    >>> user_browser.open(gnome_owner_browser.url)
    Traceback (most recent call last):
    ...
    Unauthorized...

Let's post to the form, setting the translation group to polyglot and
closed permissions.

    >>> gnome_owner_browser.getControl(
    ...     'Translation permissions policy').displayValue = ['Closed']
    >>> print gnome_owner_browser.getControl(
    ...     'Translation group').displayOptions
    ['(no value)', 'Single-language Translators',
     'The PolyGlot Translation Group', 'Just a testing team']

    >>> gnome_owner_browser.getControl(
    ...     'Translation group').displayValue = [
    ...         'The PolyGlot Translation Group']
    >>> gnome_owner_browser.getControl('Change').click()

And make sure these changes are now reflected in the Gnome project page
in the relevant portlet.

    >>> gnome_owner_browser.url
    'http://translations.launchpad.dev/gnome'
    >>> print gnome_owner_browser.title
    Translations : GNOME