~launchpad-pqm/launchpad/devel

9010.1.8 by Curtis Hovey
Cleaned up whitespace and headers.
1
Review person
2
=============
7785.1.1 by Curtis Hovey
Replaced untested yucky code with tested nice code.
3
9010.1.8 by Curtis Hovey
Cleaned up whitespace and headers.
4
Launchpad admins such as Foo Bar can review users and update some of
5
their information.
7785.1.1 by Curtis Hovey
Replaced untested yucky code with tested nice code.
6
7
    >>> admin_browser.open('http://launchpad.dev/~salgado')
8
9
    >>> admin_browser.getLink('Administer').click()
10
    >>> print admin_browser.url
11
    http://launchpad.dev/~salgado/+review
9010.1.8 by Curtis Hovey
Cleaned up whitespace and headers.
12
7785.1.1 by Curtis Hovey
Replaced untested yucky code with tested nice code.
13
    >>> print admin_browser.title
9322.10.28 by Guilherme Salgado
Fix a ton of tests
14
    Review person...
7785.1.1 by Curtis Hovey
Replaced untested yucky code with tested nice code.
15
16
    >>> admin_browser.getControl(
17
    ...     'Display Name', index=0).value = 'The one and only Salgado'
18
    >>> admin_browser.getControl('Change').click()
19
    >>> print admin_browser.title
20
    The one and only Salgado in Launchpad
21
7806.1.1 by Curtis Hovey
Added +reviewaccount to permit admins to review account information and suspend users.
22
9010.1.8 by Curtis Hovey
Cleaned up whitespace and headers.
23
Review account
24
--------------
7806.1.1 by Curtis Hovey
Added +reviewaccount to permit admins to review account information and suspend users.
25
26
The review page has a link to the review account page.
27
28
    >>> admin_browser.getLink('Administer').click()
29
    >>> link = admin_browser.getLink(url='+reviewaccount')
30
    >>> print link.text
31
    edit[IMG] Review the user's account information
32
33
    >>> link.click()
34
    >>> print admin_browser.title
9322.10.28 by Guilherme Salgado
Fix a ton of tests
35
    Review person's account...
7806.1.1 by Curtis Hovey
Added +reviewaccount to permit admins to review account information and suspend users.
36
37
The +reviewaccount page displays account information that is normally
38
hidden from the UI.
39
40
    >>> content = find_main_content(admin_browser.contents)
41
    >>> for tr in content.find(id='summary').findAll('tr'):
42
    ...     print extract_text(tr)
43
    Created: 2005-06-06
44
    Creation reason: Created by the owner himself, coming from Launchpad.
6374.17.28 by Stuart Bishop
Fix admin people merge screen and test
45
    OpenID Identifiers: salgado_oid
7806.1.1 by Curtis Hovey
Added +reviewaccount to permit admins to review account information and suspend users.
46
    Email Addresses: guilherme.salgado@canonical.com
47
48
The page also contains a link back to the +review page.
49
10197.4.17 by Curtis Hovey
Updated tests to not check for broken bread crumbs.
50
    >>> link = admin_browser.getLink(url='+review')
7806.1.1 by Curtis Hovey
Added +reviewaccount to permit admins to review account information and suspend users.
51
    >>> print link.text
52
    edit[IMG] Review the user's Launchpad information
53
10027.1.33 by Henning Eggers
Added feedback message when suspending an account.
54
The admin can update the user's account. Suspending an account will give a
55
feedback message.
7806.1.1 by Curtis Hovey
Added +reviewaccount to permit admins to review account information and suspend users.
56
57
    >>> admin_browser.getControl(
58
    ...     'The status of this account').value = ['SUSPENDED']
59
    >>> admin_browser.getControl(
60
    ...     name='field.status_comment').value = 'Bad boy.'
61
    >>> admin_browser.getControl('Change').click()
10023.2.5 by Curtis Hovey
Revised grammar. Updated stories to verify or ignore 410 status codes.
62
7806.1.1 by Curtis Hovey
Added +reviewaccount to permit admins to review account information and suspend users.
63
    >>> print admin_browser.title
64
    The one and only Salgado does not use Launchpad
10027.1.33 by Henning Eggers
Added feedback message when suspending an account.
65
    >>> print get_feedback_messages(admin_browser.contents)[0]
10556.4.7 by Guilherme Salgado
Fix a couple tests. These should be the last ones.
66
    The account "Guilherme Salgado" has been suspended.
7806.1.1 by Curtis Hovey
Added +reviewaccount to permit admins to review account information and suspend users.
67
68
The admin can see the account information of a user that does not use
10067.3.1 by Curtis Hovey
Raise a GoneError (HTTP 410) when traversing suspended user
69
Launchpad, and can change the account too. Note that all pages that belong
70
to a suspended user have a 410 status code to ensure search engines remove
71
them from their index.
7806.1.1 by Curtis Hovey
Added +reviewaccount to permit admins to review account information and suspend users.
72
73
    >>> admin_browser.getLink('Administer').click()
74
    >>> admin_browser.getLink(url='+reviewaccount').click()
75
    >>> print admin_browser.title
9322.10.28 by Guilherme Salgado
Fix a ton of tests
76
    Review person's account...
7806.1.1 by Curtis Hovey
Added +reviewaccount to permit admins to review account information and suspend users.
77
78
    >>> control = admin_browser.getControl(name='field.status_comment')
79
    >>> print control.value
80
    Bad boy.
81
82
    >>> control.value = 'Reinstated after he apologised'
83
    >>> admin_browser.getControl(
84
    ...     'The status of this account').value = ['ACTIVE']
85
    >>> admin_browser.getControl('Change').click()
86
    >>> print admin_browser.title
87
    The one and only Salgado does not use Launchpad
88
89
    >>> for message in get_feedback_messages(admin_browser.contents):
90
    ...     print message
91
    The user is reactivated. He must use the "forgot password" to log in.
92
93
11326.2.3 by Brad Crittenden
Change ProjectReview to Moderate. Let registry experts perform some edits on pillars.
94
Registry experts
95
----------------
96
11403.2.4 by Brad Crittenden
Tweaked config for person to disallow registry experts from changing display name.
97
Registry experts can see the +review page, minus the displayname.
11326.2.3 by Brad Crittenden
Change ProjectReview to Moderate. Let registry experts perform some edits on pillars.
98
11326.2.6 by Brad Crittenden
Added a factory method to add a registry expert
99
    >>> email = "expert@example.com"
100
    >>> password = "test"
101
    >>> expert= factory.makeRegistryExpert(email=email, password=password)
102
    >>> expert_browser = setupBrowser(auth='Basic %s:%s' % (email, password))
10027.1.1 by Henning Eggers
Extended page test to test for access for registry admins to +reviewaccount.
103
    >>> logout()
11326.2.3 by Brad Crittenden
Change ProjectReview to Moderate. Let registry experts perform some edits on pillars.
104
    >>> expert_browser.open('http://launchpad.dev/~no-priv/+review')
105
    >>> print expert_browser.title
106
    Review person...
107
11403.2.1 by Brad Crittenden
Changed attribute permissions to allow registry experts to edit them
108
    >>> expert_browser.getControl('Name', index=0).value = "no-way"
109
    >>> expert_browser.getControl(
11403.2.4 by Brad Crittenden
Tweaked config for person to disallow registry experts from changing display name.
110
    ...     'Display Name', index=0)
111
    Traceback (most recent call last):
112
    ...
113
    LookupError: label 'Display Name'
114
11403.2.2 by Brad Crittenden
Fixed permissions for personal standing fields
115
    >>> expert_browser.getControl('Personal standing').value = ['GOOD']
116
    >>> expert_browser.getControl(
117
    ...     name='field.personal_standing_reason').value = 'good guy'
11403.2.1 by Brad Crittenden
Changed attribute permissions to allow registry experts to edit them
118
    >>> expert_browser.getControl('Change').click()
119
    >>> print expert_browser.url
120
    http://launchpad.dev/~no-way
121
11326.2.3 by Brad Crittenden
Change ProjectReview to Moderate. Let registry experts perform some edits on pillars.
122
However, members of the registry team only get partial access to the
123
review account page to be able to suspend spam accounts.
124
11403.2.1 by Brad Crittenden
Changed attribute permissions to allow registry experts to edit them
125
    >>> expert_browser.open('http://launchpad.dev/~no-way/+reviewaccount')
10027.1.1 by Henning Eggers
Extended page test to test for access for registry admins to +reviewaccount.
126
    >>> print expert_browser.title
127
    Review person's account...
128
129
The +reviewaccount page does not display account information for registry
10027.1.22 by Henning Eggers
Extended page test.
130
experts. It also has no form elements to change the display name or the
131
password.
10027.1.1 by Henning Eggers
Extended page test to test for access for registry admins to +reviewaccount.
132
10027.1.12 by Henning Eggers
Fixed permission helper.
133
    >>> content = find_main_content(expert_browser.contents)
10027.1.1 by Henning Eggers
Extended page test to test for access for registry admins to +reviewaccount.
134
    >>> print content.find(id='summary')
135
    None
10027.1.22 by Henning Eggers
Extended page test.
136
    >>> print content.find(name='field.displayname')
137
    None
138
    >>> print content.find(name='field.password')
139
    None
140
10027.1.32 by Henning Eggers
Fixed comment typos.
141
The only option for registry experts is to change an account's status and to
10027.1.31 by Henning Eggers
Redirect to people page after suspending an account as a non-admin.
142
provide a reason why they did it. After suspending the account the
143
page will only be visible to admins, so the registry expert will be
10027.1.33 by Henning Eggers
Added feedback message when suspending an account.
144
redirected to the "people" main page. A feedback message informs the expert
145
about the suspension.
10027.1.22 by Henning Eggers
Extended page test.
146
147
    >>> control = expert_browser.getControl(name='field.status_comment')
148
    >>> control.value = 'This is SPAM!'
149
    >>> expert_browser.getControl(
150
    ...     'The status of this account').value = ['SUSPENDED']
151
    >>> expert_browser.getControl('Change').click()
10027.1.31 by Henning Eggers
Redirect to people page after suspending an account as a non-admin.
152
    >>> print expert_browser.url
153
    http://launchpad.dev/people
10027.1.33 by Henning Eggers
Added feedback message when suspending an account.
154
    >>> print get_feedback_messages(expert_browser.contents)[0]
155
    The account "No Privileges Person" has been suspended.
10027.1.1 by Henning Eggers
Extended page test to test for access for registry admins to +reviewaccount.
156
157
9010.1.8 by Curtis Hovey
Cleaned up whitespace and headers.
158
Restricted to admins
159
--------------------
7806.1.1 by Curtis Hovey
Added +reviewaccount to permit admins to review account information and suspend users.
160
161
Non admins cannot access the +review and +reviewaccount pages.
7785.1.1 by Curtis Hovey
Replaced untested yucky code with tested nice code.
162
163
    >>> user_browser.open('http://launchpad.dev/~salgado')
164
    >>> user_browser.getLink('Administer')
165
    Traceback (most recent call last):
166
    ...
167
    LinkNotFoundError
168
169
    >>> user_browser.open('http://launchpad.dev/~salgado/+review')
170
    Traceback (most recent call last):
171
    ...
172
    Unauthorized: ...
7806.1.1 by Curtis Hovey
Added +reviewaccount to permit admins to review account information and suspend users.
173
174
    >>> user_browser.open('http://launchpad.dev/~salgado/+reviewaccount')
175
    Traceback (most recent call last):
176
    ...
177
    Unauthorized: ...