~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
Check to see no CoC signature is registered for Mark:

    >>> admin_browser.open('http://localhost:9000/codeofconduct/console')
    >>> admin_browser.getControl(name='searchfor').value = ["all"]
    >>> admin_browser.getControl(name='name').value = "mark"
    >>> admin_browser.getControl(name='search').click()
    >>> "No signatures found." in admin_browser.contents
    True

Perform Acknowledge process as Foo bar person:

    >>> admin_browser.open('http://localhost:9000/codeofconduct/console/+new')
    >>> admin_browser.title
    'Register a code of conduct signature'

    >>> admin_browser.getControl(
    ...     name='field.owner').value = "mark@example.com"
    >>> admin_browser.getControl('Register').click()
    >>> admin_browser.url
    'http://localhost:9000/codeofconduct/console'

Ensure the CoC was acknowledge by searching in the CoC Admin Console:

    >>> admin_browser.open('http://launchpad.dev/codeofconduct/console')
    >>> admin_browser.getControl(name='searchfor').value = ["all"]
    >>> admin_browser.getControl(name='name').value = "mark"
    >>> admin_browser.getControl(name='search').click()
    >>> print extract_text(find_tag_by_id(admin_browser.contents, 'matches'))
    Mark ... paper submission accepted by Foo Bar [ACTIVE]

Test if the advertisement email was sent:

    >>> import email
    >>> from lp.services.mail import stub
    >>> from_addr, to_addrs, raw_msg = stub.test_emails.pop()
    >>> msg = email.message_from_string(raw_msg)
    >>> print msg.get_payload(decode=True)
    <BLANKLINE>
    ...
    User: 'Mark Shuttleworth'
    Paper Submitted acknowledge by Foo Bar
    ...