~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/translations/stories/webservice/xx-translationfocus.txt

merge changes from db-devel

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
= Translation focus =
 
2
 
 
3
The translation focus of a project is the series chosen as the preferred
 
4
one to be translated. It's optional. When not set, Launchpad suggests
 
5
the development focus as the preferred series to translate, which is
 
6
outside the scope of this test.
 
7
 
 
8
    >>> evolution = webservice.get('/evolution').jsonBody()
 
9
    >>> print evolution['development_focus_link']
 
10
    http://.../evolution/trunk
 
11
    >>> print evolution['translation_focus_link']
 
12
    None
 
13
 
 
14
It's possible to set the translation focus through the API
 
15
if you're an admin. The translation focus should be a project series.
 
16
 
 
17
    >>> from simplejson import dumps
 
18
    >>> print webservice.patch(
 
19
    ...     evolution['self_link'], 'application/json',
 
20
    ...     dumps({'translation_focus_link' :
 
21
    ...         evolution['development_focus_link']}))
 
22
    HTTP/1.1 209 Content Returned
 
23
    ...
 
24
 
 
25
    >>> print webservice.get('/evolution').jsonBody()['translation_focus_link']
 
26
    http://.../evolution/trunk
 
27
 
 
28
Unprivileged users cannot set the translation focus.
 
29
 
 
30
    >>> print user_webservice.patch(
 
31
    ...     evolution['self_link'], 'application/json',
 
32
    ...     dumps({'translation_focus_link': None}))
 
33
    HTTP... 401 Unauthorized
 
34
    ...