~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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Deactivating user accounts
==========================

Users who don't want to use Launchpad anymore can easily deactivate their
accounts so they stop receiving emails from Launchpad and make it impossible
to use their accounts to log in.

Deactivating a user's account will un-assign all their bug tasks. To
demonstrate this, we'll assign a bug to the user that we're going to
deactivate.

    >>> browser = setupBrowser(auth='Basic test@canonical.com:test')
    >>> edit_bug_url = ("http://bugs.launchpad.dev/debian/sarge/+source/"
    ...     "mozilla-firefox/+bug/3/+editstatus")
    >>> browser.open(edit_bug_url)
    >>> bugwatch_control = browser.getControl(
    ...     name='debian_sarge_mozilla-firefox.bugwatch')
    >>> bugwatch_control.value = []
    >>> browser.getControl('Save Changes').click()

    >>> browser.open(edit_bug_url)
    >>> assignee_control = browser.getControl(
    ...     name='debian_sarge_mozilla-firefox.assignee.option')
    >>> assignee_control.value = [
    ...     'debian_sarge_mozilla-firefox.assignee.assign_to_me']
    >>> browser.getControl('Save Changes').click()

There's a link to the +deactivate-account page in a person's +edit page.

    >>> browser.open('http://launchpad.dev/~name12')
    >>> browser.getLink('Change details').click()
    >>> browser.url
    'http://launchpad.dev/~name12/+edit'

    >>> browser.getLink('Deactivate your account').click()
    >>> browser.url
    'http://launchpad.dev/~name12/+deactivate-account'

    >>> browser.getControl('Deactivate My Account').click()
    >>> browser.url
    'http://launchpad.dev'
    >>> for msg in get_feedback_messages(browser.contents):
    ...     print msg
    Your account has been deactivated.

And now the Launchpad page for Sample Person person will clearly say he
does not use Launchpad.

    >>> browser.open('http://launchpad.dev/~name12-deactivatedaccount')
    >>> print extract_text(
    ...     find_tag_by_id(browser.contents, 'not-lp-user-or-team'))
    Sample Person does not use Launchpad.

The bugs that were assigned to Sample Person will no longer have an
assignee.

    >>> browser.open('http://launchpad.dev/debian/+source/'
    ...     'mozilla-firefox/+bug/3')
    >>> print extract_text(find_main_content(browser.contents))
    Bug Title Test
    Debian
    “mozilla-firefox” package
    Bug #3
    ...
    Assigned to
    Milestone
    ...

Although teams have NOACCOUNT as their account_status, they are teams and so
it makes no sense to say they don't use Launchpad.

    >>> browser.open('http://launchpad.dev/~ubuntu-team')
    >>> print find_tag_by_id(browser.contents, 'not-lp-user-or-team')
    None

The action of deactivating an account is something that can only be done by
the user himself --not even Launchpad admins can do that on behalf of other
people.

    >>> admin_browser.open('http://launchpad.dev/~cprov/+deactivate-account')
    Traceback (most recent call last):
    ...
    Unauthorized: ...