~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-07-26 21:48:06 UTC
  • mfrom: (13506.6.3 bug-815623)
  • Revision ID: launchpad@pqm.canonical.com-20110726214806-v2j41ddaem16f6wa
[r=wgrant][bug=815623] Do not notify team admins about membership
 changes in open teams.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    >>> from lp.registry.interfaces.person import (
31
31
    ...     IPersonSet,
32
32
    ...     TeamMembershipRenewalPolicy,
 
33
    ...     TeamSubscriptionPolicy,
33
34
    ...     )
34
35
    >>> from lp.registry.interfaces.teammembership import (
35
36
    ...     ITeamMembershipSet,
45
46
    >>> admin_person = personset.getByEmail(ADMIN_EMAIL)
46
47
 
47
48
 
 
49
In open teams joining and leaving the team generates no notifications.
 
50
 
 
51
    >>> login_person(admin_person)
 
52
    >>> ubuntu_team_policy = ubuntu_team.subscriptionpolicy
 
53
    >>> ubuntu_team.subscriptionpolicy = TeamSubscriptionPolicy.OPEN
 
54
    >>> base_mails = len(stub.test_emails)
 
55
    >>> new_person = factory.makePerson()
 
56
    >>> login_person(new_person)
 
57
    >>> new_person.join(ubuntu_team)
 
58
    >>> membership = membershipset.getByPersonAndTeam(new_person, ubuntu_team)
 
59
    >>> membership.status.title
 
60
    'Approved'
 
61
    >>> run_mail_jobs()
 
62
    >>> len(stub.test_emails) - base_mails
 
63
    0
 
64
    >>> new_person.leave(ubuntu_team)
 
65
    >>> run_mail_jobs()
 
66
    >>> len(stub.test_emails) - base_mails
 
67
    0
 
68
 
 
69
Put ubuntu back to the original status:
 
70
 
 
71
    >>> login_person(admin_person)
 
72
    >>> ubuntu_team.subscriptionpolicy = ubuntu_team_policy
 
73
 
48
74
Now Robert Collins proposes himself as a member of the Ubuntu Team. This
49
75
generates a notification email only to Ubuntu Team administrators.
50
76
 
875
901
    >>> ignored = team_one.addMember(member, owner)
876
902
    >>> print_distinct_emails()
877
903
    From: Team One ...
878
 
    ----------------------------------------
879
 
    From: Team One ...
880
904
    To: team-member...
881
905
    X-Launchpad-Message-Rationale: Member (team-one)
882
906
    Subject: You have been added to team-one
901
925
    >>> ignored = team_one.addMember(team_two, owner, force_team_add=True)
902
926
    >>> print_distinct_emails()
903
927
    From: Team One ...
904
 
    ----------------------------------------
905
 
    From: Team One ...
906
928
    To: team-two...
907
929
    X-Launchpad-Message-Rationale: Indirect member (team-one)
908
930
    Subject: team-two joined team-one