~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/doc/teammembership-email-notification.txt

Merged replication into pending-db-changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    >>> kamion = personset.getByName('kamion')
43
43
    >>> sampleperson = personset.getByName('name12')
44
44
    >>> ubuntu_team = personset.getByName('ubuntu-team')
 
45
    >>> open_team = factory.makeTeam(
 
46
    ...     subscription_policy=TeamSubscriptionPolicy.OPEN)
45
47
    >>> from lp.testing.sampledata import ADMIN_EMAIL
46
48
    >>> admin_person = personset.getByEmail(ADMIN_EMAIL)
47
49
 
49
51
In open teams joining and leaving the team generates no notifications.
50
52
 
51
53
    >>> login_person(admin_person)
52
 
    >>> ubuntu_team_policy = ubuntu_team.subscriptionpolicy
53
 
    >>> ubuntu_team.subscriptionpolicy = TeamSubscriptionPolicy.OPEN
54
54
    >>> base_mails = len(stub.test_emails)
55
55
    >>> new_person = factory.makePerson()
56
56
    >>> login_person(new_person)
57
 
    >>> new_person.join(ubuntu_team)
58
 
    >>> membership = membershipset.getByPersonAndTeam(new_person, ubuntu_team)
 
57
    >>> new_person.join(open_team)
 
58
    >>> membership = membershipset.getByPersonAndTeam(new_person, open_team)
59
59
    >>> membership.status.title
60
60
    'Approved'
61
61
    >>> run_mail_jobs()
62
62
    >>> len(stub.test_emails) - base_mails
63
63
    0
64
 
    >>> new_person.leave(ubuntu_team)
 
64
    >>> new_person.leave(open_team)
65
65
    >>> run_mail_jobs()
66
66
    >>> len(stub.test_emails) - base_mails
67
67
    0
68
68
 
69
 
Put ubuntu back to the original status:
70
 
 
71
 
    >>> login_person(admin_person)
72
 
    >>> ubuntu_team.subscriptionpolicy = ubuntu_team_policy
73
69
 
74
70
Now Robert Collins proposes himself as a member of the Ubuntu Team. This
75
71
generates a notification email only to Ubuntu Team administrators.