Merge lp:~edwin-grubbs/launchpad/bug-482176-add-team-member-ajax-part3 into lp:launchpad
- bug-482176-add-team-member-ajax-part3
- Merge into devel
Proposed by
Edwin Grubbs
Status: | Merged |
---|---|
Approved by: | Aaron Bentley |
Approved revision: | not available |
Merged at revision: | not available |
Proposed branch: | lp:~edwin-grubbs/launchpad/bug-482176-add-team-member-ajax-part3 |
Merge into: | lp:launchpad |
Prerequisite: | lp:~edwin-grubbs/launchpad/bug-482176-add-team-member-ajax-part2 |
Diff against target: |
1635 lines (+279/-220) 57 files modified
lib/canonical/launchpad/pagetests/standalone/xx-beta-testers-redirection.txt (+1/-1) lib/lp/answers/doc/person.txt (+2/-2) lib/lp/bugs/browser/tests/bug-views.txt (+1/-1) lib/lp/bugs/doc/bugnotification-comment-syncing-team.txt (+1/-1) lib/lp/bugs/doc/bugnotification-sending.txt (+4/-2) lib/lp/bugs/doc/bugtask.txt (+2/-1) lib/lp/bugs/stories/bugwatches/xx-bugwatch-comments.txt (+1/-1) lib/lp/code/stories/branches/xx-branch-deletion.txt (+1/-1) lib/lp/code/stories/feeds/xx-revision-atom.txt (+1/-1) lib/lp/registry/browser/team.py (+5/-3) lib/lp/registry/browser/tests/peoplemerge-views.txt (+1/-1) lib/lp/registry/browser/tests/person-views.txt (+1/-1) lib/lp/registry/browser/tests/product-views.txt (+1/-1) lib/lp/registry/browser/tests/projectgroupset-views.txt (+1/-1) lib/lp/registry/browser/tests/team-views.txt (+4/-4) lib/lp/registry/browser/tests/teammembership-views.txt (+1/-2) lib/lp/registry/doc/announcement.txt (+1/-1) lib/lp/registry/doc/commercialsubscription.txt (+1/-1) lib/lp/registry/doc/mailinglist-email-notification.txt (+8/-5) lib/lp/registry/doc/mailinglist-subscriptions.txt (+3/-3) lib/lp/registry/doc/mailinglists.txt (+2/-1) lib/lp/registry/doc/person-merge.txt (+3/-3) lib/lp/registry/doc/person.txt (+2/-2) lib/lp/registry/doc/private-team-visibility.txt (+3/-3) lib/lp/registry/doc/teammembership-email-notification.txt (+7/-12) lib/lp/registry/doc/teammembership.txt (+100/-63) lib/lp/registry/doc/vocabularies.txt (+2/-3) lib/lp/registry/stories/mailinglists/lifecycle.txt (+1/-1) lib/lp/registry/stories/mailinglists/subscriptions.txt (+3/-3) lib/lp/registry/stories/person/xx-admin-person-review.txt (+2/-1) lib/lp/registry/stories/product/xx-product-edit.txt (+1/-1) lib/lp/registry/stories/product/xx-productset.txt (+1/-1) lib/lp/registry/stories/team/xx-team-add-my-teams.txt (+40/-38) lib/lp/registry/stories/teammembership/20-managing-members.txt (+14/-5) lib/lp/registry/stories/teammembership/private-team.txt (+1/-1) lib/lp/registry/stories/teammembership/xx-add-member.txt (+15/-12) lib/lp/registry/stories/teammembership/xx-expire-subscription.txt (+1/-1) lib/lp/registry/stories/teammembership/xx-member-renewed-membership.txt (+1/-1) lib/lp/registry/stories/teammembership/xx-private-membership.txt (+4/-4) lib/lp/registry/stories/vouchers/xx-voucher-redemption.txt (+2/-1) lib/lp/registry/stories/webservice/xx-private-membership.txt (+4/-3) lib/lp/registry/stories/webservice/xx-source-package.txt (+1/-1) lib/lp/registry/stories/webservice/xx-structuralsubscription.txt (+1/-1) lib/lp/registry/tests/bug-249185.txt (+5/-4) lib/lp/registry/tests/test_teammembership.py (+4/-4) lib/lp/soyuz/browser/tests/archive-views.txt (+2/-2) lib/lp/soyuz/browser/tests/build-views.txt (+1/-1) lib/lp/soyuz/doc/archive.txt (+3/-2) lib/lp/soyuz/doc/archivepermission.txt (+1/-1) lib/lp/soyuz/doc/archivesubscriber.txt (+2/-1) lib/lp/soyuz/doc/build-notification.txt (+1/-1) lib/lp/soyuz/doc/build.txt (+3/-3) lib/lp/soyuz/doc/distroseriesqueue-dist-upgrader.txt (+1/-1) lib/lp/soyuz/doc/packageset.txt (+1/-1) lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.txt (+1/-1) lib/lp/soyuz/stories/soyuz/xx-private-builds.txt (+1/-1) lib/lp/translations/stories/standalone/xx-sourcepackage-export.txt (+1/-1) |
To merge this branch: | bzr merge lp:~edwin-grubbs/launchpad/bug-482176-add-team-member-ajax-part3 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Aaron Bentley (community) | code | Approve | |
Review via email: mp+16804@code.launchpad.net |
Commit message
Add member via ajax link on team +index page.
Description of the change
To post a comment you must log in.
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote : | # |
Revision history for this message
Aaron Bentley (abentley) wrote : | # |
The documentation is inverted here:
+First invite ubuntu-team to be member of the name20 team.
- >>> browser.open('http://
- >>> browser.
+ >>> browser = setupBrowser(
+ ... auth='Basic <email address hidden>:test')
+ >>> browser.open('http://
+ >>> browser.
>>> browser.
(name20 is added to ubuntu-team)
Other than that, this looks okay to land.
review:
Approve
(code)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/canonical/launchpad/pagetests/standalone/xx-beta-testers-redirection.txt' | |||
2 | --- lib/canonical/launchpad/pagetests/standalone/xx-beta-testers-redirection.txt 2009-09-16 08:11:22 +0000 | |||
3 | +++ lib/canonical/launchpad/pagetests/standalone/xx-beta-testers-redirection.txt 2010-01-05 17:55:34 +0000 | |||
4 | @@ -239,7 +239,7 @@ | |||
5 | 239 | >>> foo_bar = getUtility(IPersonSet).getByName('name16') | 239 | >>> foo_bar = getUtility(IPersonSet).getByName('name16') |
6 | 240 | >>> launchpad_beta_testers = getUtility( | 240 | >>> launchpad_beta_testers = getUtility( |
7 | 241 | ... ILaunchpadCelebrities).launchpad_beta_testers | 241 | ... ILaunchpadCelebrities).launchpad_beta_testers |
9 | 242 | >>> launchpad_beta_testers.addMember(foo_bar, reviewer=foo_bar) | 242 | >>> ignored = launchpad_beta_testers.addMember(foo_bar, reviewer=foo_bar) |
10 | 243 | >>> foo_bar.inTeam(launchpad_beta_testers) | 243 | >>> foo_bar.inTeam(launchpad_beta_testers) |
11 | 244 | True | 244 | True |
12 | 245 | 245 | ||
13 | 246 | 246 | ||
14 | === modified file 'lib/lp/answers/doc/person.txt' | |||
15 | --- lib/lp/answers/doc/person.txt 2009-04-17 10:32:16 +0000 | |||
16 | +++ lib/lp/answers/doc/person.txt 2010-01-05 17:55:34 +0000 | |||
17 | @@ -279,7 +279,7 @@ | |||
18 | 279 | contact through his team membership. | 279 | contact through his team membership. |
19 | 280 | 280 | ||
20 | 281 | >>> landscape_team = personset.getByName("landscape-developers") | 281 | >>> landscape_team = personset.getByName("landscape-developers") |
22 | 282 | >>> landscape_team.addMember(no_priv_raw, foo_bar_raw) | 282 | >>> ignored = landscape_team.addMember(no_priv_raw, foo_bar_raw) |
23 | 283 | >>> no_priv_raw.inTeam(landscape_team) | 283 | >>> no_priv_raw.inTeam(landscape_team) |
24 | 284 | True | 284 | True |
25 | 285 | 285 | ||
26 | @@ -301,7 +301,7 @@ | |||
27 | 301 | >>> translator_team = personset.getByName('ubuntu-translators') | 301 | >>> translator_team = personset.getByName('ubuntu-translators') |
28 | 302 | >>> no_priv_raw.inTeam(translator_team) | 302 | >>> no_priv_raw.inTeam(translator_team) |
29 | 303 | False | 303 | False |
31 | 304 | >>> translator_team.addMember(landscape_team, carlos_raw) | 304 | >>> ignored = translator_team.addMember(landscape_team, carlos_raw) |
32 | 305 | 305 | ||
33 | 306 | # We need to accept the invitation sent by the addMember() call in | 306 | # We need to accept the invitation sent by the addMember() call in |
34 | 307 | # order to make landscape_team an actual member of translator_team. | 307 | # order to make landscape_team an actual member of translator_team. |
35 | 308 | 308 | ||
36 | === modified file 'lib/lp/bugs/browser/tests/bug-views.txt' | |||
37 | --- lib/lp/bugs/browser/tests/bug-views.txt 2009-06-12 16:36:02 +0000 | |||
38 | +++ lib/lp/bugs/browser/tests/bug-views.txt 2010-01-05 17:55:34 +0000 | |||
39 | @@ -710,7 +710,7 @@ | |||
40 | 710 | People in the team get to see the comments. | 710 | People in the team get to see the comments. |
41 | 711 | 711 | ||
42 | 712 | >>> login('foo.bar@canonical.com') | 712 | >>> login('foo.bar@canonical.com') |
44 | 713 | >>> syncing_team.addMember(no_priv, no_priv) | 713 | >>> ignored = syncing_team.addMember(no_priv, no_priv) |
45 | 714 | 714 | ||
46 | 715 | >>> login('no-priv@canonical.com') | 715 | >>> login('no-priv@canonical.com') |
47 | 716 | >>> view = BugTaskView(bug.bugtasks[0], LaunchpadTestRequest()) | 716 | >>> view = BugTaskView(bug.bugtasks[0], LaunchpadTestRequest()) |
48 | 717 | 717 | ||
49 | === modified file 'lib/lp/bugs/doc/bugnotification-comment-syncing-team.txt' | |||
50 | --- lib/lp/bugs/doc/bugnotification-comment-syncing-team.txt 2009-06-12 16:36:02 +0000 | |||
51 | +++ lib/lp/bugs/doc/bugnotification-comment-syncing-team.txt 2010-01-05 17:55:34 +0000 | |||
52 | @@ -64,7 +64,7 @@ | |||
53 | 64 | Members of the syncing team will get the notifications. | 64 | Members of the syncing team will get the notifications. |
54 | 65 | 65 | ||
55 | 66 | >>> LaunchpadZopelessLayer.switchDbUser('launchpad') | 66 | >>> LaunchpadZopelessLayer.switchDbUser('launchpad') |
57 | 67 | >>> syncing_team.addMember(no_priv, no_priv) | 67 | >>> ignored = syncing_team.addMember(no_priv, no_priv) |
58 | 68 | >>> transaction.commit() | 68 | >>> transaction.commit() |
59 | 69 | 69 | ||
60 | 70 | >>> LaunchpadZopelessLayer.switchDbUser('bugnotification') | 70 | >>> LaunchpadZopelessLayer.switchDbUser('bugnotification') |
61 | 71 | 71 | ||
62 | === modified file 'lib/lp/bugs/doc/bugnotification-sending.txt' | |||
63 | --- lib/lp/bugs/doc/bugnotification-sending.txt 2009-12-05 18:37:28 +0000 | |||
64 | +++ lib/lp/bugs/doc/bugnotification-sending.txt 2010-01-05 17:55:34 +0000 | |||
65 | @@ -1280,7 +1280,8 @@ | |||
66 | 1280 | ... displayname='Concise Team Person', | 1280 | ... displayname='Concise Team Person', |
67 | 1281 | ... email='conciseteam@example.com') | 1281 | ... email='conciseteam@example.com') |
68 | 1282 | >>> concise_team_person.verbose_bugnotifications = True | 1282 | >>> concise_team_person.verbose_bugnotifications = True |
70 | 1283 | >>> concise_team.addMember(concise_team_person, concise_team_person) | 1283 | >>> ignored = concise_team.addMember( |
71 | 1284 | ... concise_team_person, concise_team_person) | ||
72 | 1284 | >>> bug.subscribe(concise_team, concise_team_person) | 1285 | >>> bug.subscribe(concise_team, concise_team_person) |
73 | 1285 | <BugSubscription...> | 1286 | <BugSubscription...> |
74 | 1286 | 1287 | ||
75 | @@ -1294,7 +1295,8 @@ | |||
76 | 1294 | ... displayname='Verbose Team Person', | 1295 | ... displayname='Verbose Team Person', |
77 | 1295 | ... email='verboseteam@example.com') | 1296 | ... email='verboseteam@example.com') |
78 | 1296 | >>> verbose_team_person.verbose_bugnotifications = False | 1297 | >>> verbose_team_person.verbose_bugnotifications = False |
80 | 1297 | >>> verbose_team.addMember(verbose_team_person, verbose_team_person) | 1298 | >>> ignored = verbose_team.addMember( |
81 | 1299 | ... verbose_team_person, verbose_team_person) | ||
82 | 1298 | >>> bug.subscribe(verbose_team, verbose_team_person) | 1300 | >>> bug.subscribe(verbose_team, verbose_team_person) |
83 | 1299 | <BugSubscription...> | 1301 | <BugSubscription...> |
84 | 1300 | 1302 | ||
85 | 1301 | 1303 | ||
86 | === modified file 'lib/lp/bugs/doc/bugtask.txt' | |||
87 | --- lib/lp/bugs/doc/bugtask.txt 2009-08-27 07:58:37 +0000 | |||
88 | +++ lib/lp/bugs/doc/bugtask.txt 2010-01-05 17:55:34 +0000 | |||
89 | @@ -959,7 +959,8 @@ | |||
90 | 959 | Team *is* subscribed to the bug, No Privileges Person will see the private bug. | 959 | Team *is* subscribed to the bug, No Privileges Person will see the private bug. |
91 | 960 | 960 | ||
92 | 961 | >>> login("mark@example.com") | 961 | >>> login("mark@example.com") |
94 | 962 | >>> ubuntu_team.addMember(no_priv, reviewer=ubuntu_team.teamowner) | 962 | >>> ignored = ubuntu_team.addMember( |
95 | 963 | ... no_priv, reviewer=ubuntu_team.teamowner) | ||
96 | 963 | 964 | ||
97 | 964 | >>> login("no-priv@canonical.com") | 965 | >>> login("no-priv@canonical.com") |
98 | 965 | >>> params = BugTaskSearchParams( | 966 | >>> params = BugTaskSearchParams( |
99 | 966 | 967 | ||
100 | === modified file 'lib/lp/bugs/stories/bugwatches/xx-bugwatch-comments.txt' | |||
101 | --- lib/lp/bugs/stories/bugwatches/xx-bugwatch-comments.txt 2009-09-02 12:33:41 +0000 | |||
102 | +++ lib/lp/bugs/stories/bugwatches/xx-bugwatch-comments.txt 2010-01-05 17:55:34 +0000 | |||
103 | @@ -55,7 +55,7 @@ | |||
104 | 55 | >>> foo_bar = getUtility(IPersonSet).getByName('name16') | 55 | >>> foo_bar = getUtility(IPersonSet).getByName('name16') |
105 | 56 | >>> launchpad_beta_testers = getUtility( | 56 | >>> launchpad_beta_testers = getUtility( |
106 | 57 | ... ILaunchpadCelebrities).launchpad_beta_testers | 57 | ... ILaunchpadCelebrities).launchpad_beta_testers |
108 | 58 | >>> launchpad_beta_testers.addMember(mark, reviewer=foo_bar) | 58 | >>> ignored = launchpad_beta_testers.addMember(mark, reviewer=foo_bar) |
109 | 59 | >>> mark.inTeam(launchpad_beta_testers) | 59 | >>> mark.inTeam(launchpad_beta_testers) |
110 | 60 | True | 60 | True |
111 | 61 | 61 | ||
112 | 62 | 62 | ||
113 | === modified file 'lib/lp/code/stories/branches/xx-branch-deletion.txt' | |||
114 | --- lib/lp/code/stories/branches/xx-branch-deletion.txt 2009-09-23 14:40:53 +0000 | |||
115 | +++ lib/lp/code/stories/branches/xx-branch-deletion.txt 2010-01-05 17:55:34 +0000 | |||
116 | @@ -84,7 +84,7 @@ | |||
117 | 84 | >>> login(ANONYMOUS) | 84 | >>> login(ANONYMOUS) |
118 | 85 | >>> name12 = getUtility(IPersonSet).getByName('name12') | 85 | >>> name12 = getUtility(IPersonSet).getByName('name12') |
119 | 86 | >>> ubuntu_branches = getUtility(ILaunchpadCelebrities).ubuntu_branches | 86 | >>> ubuntu_branches = getUtility(ILaunchpadCelebrities).ubuntu_branches |
121 | 87 | >>> removeSecurityProxy(ubuntu_branches).addMember( | 87 | >>> ignored = removeSecurityProxy(ubuntu_branches).addMember( |
122 | 88 | ... name12, ubuntu_branches.teamowner) | 88 | ... name12, ubuntu_branches.teamowner) |
123 | 89 | >>> login_person(name12) | 89 | >>> login_person(name12) |
124 | 90 | >>> branch = factory.makePackageBranch(owner=name12) | 90 | >>> branch = factory.makePackageBranch(owner=name12) |
125 | 91 | 91 | ||
126 | === modified file 'lib/lp/code/stories/feeds/xx-revision-atom.txt' | |||
127 | --- lib/lp/code/stories/feeds/xx-revision-atom.txt 2009-07-09 05:12:34 +0000 | |||
128 | +++ lib/lp/code/stories/feeds/xx-revision-atom.txt 2010-01-05 17:55:34 +0000 | |||
129 | @@ -54,7 +54,7 @@ | |||
130 | 54 | 54 | ||
131 | 55 | >>> login_person(mike) | 55 | >>> login_person(mike) |
132 | 56 | >>> team = factory.makeTeam(mike, 'The M Team', name='m-team') | 56 | >>> team = factory.makeTeam(mike, 'The M Team', name='m-team') |
134 | 57 | >>> team.addMember(mary, mike) | 57 | >>> ignored = team.addMember(mary, mike) |
135 | 58 | >>> from lp.code.interfaces.revision import IRevisionSet | 58 | >>> from lp.code.interfaces.revision import IRevisionSet |
136 | 59 | >>> from zope.component import getUtility | 59 | >>> from zope.component import getUtility |
137 | 60 | >>> revision_set = getUtility(IRevisionSet) | 60 | >>> revision_set = getUtility(IRevisionSet) |
138 | 61 | 61 | ||
139 | === modified file 'lib/lp/registry/browser/team.py' | |||
140 | --- lib/lp/registry/browser/team.py 2009-12-10 18:11:38 +0000 | |||
141 | +++ lib/lp/registry/browser/team.py 2010-01-05 17:55:34 +0000 | |||
142 | @@ -993,9 +993,11 @@ | |||
143 | 993 | assert newmember != self.context, ( | 993 | assert newmember != self.context, ( |
144 | 994 | "Can't add team to itself: %s" % newmember) | 994 | "Can't add team to itself: %s" % newmember) |
145 | 995 | 995 | ||
149 | 996 | self.context.addMember(newmember, reviewer=self.user, | 996 | changed, new_status = self.context.addMember( |
150 | 997 | status=TeamMembershipStatus.APPROVED) | 997 | newmember, reviewer=self.user, |
151 | 998 | if newmember.isTeam(): | 998 | status=TeamMembershipStatus.APPROVED) |
152 | 999 | |||
153 | 1000 | if new_status == TeamMembershipStatus.INVITED: | ||
154 | 999 | msg = "%s has been invited to join this team." % ( | 1001 | msg = "%s has been invited to join this team." % ( |
155 | 1000 | newmember.unique_displayname) | 1002 | newmember.unique_displayname) |
156 | 1001 | else: | 1003 | else: |
157 | 1002 | 1004 | ||
158 | === modified file 'lib/lp/registry/browser/tests/peoplemerge-views.txt' | |||
159 | --- lib/lp/registry/browser/tests/peoplemerge-views.txt 2009-07-27 20:53:27 +0000 | |||
160 | +++ lib/lp/registry/browser/tests/peoplemerge-views.txt 2010-01-05 17:55:34 +0000 | |||
161 | @@ -38,7 +38,7 @@ | |||
162 | 38 | >>> parent_team = factory.makeTeam() | 38 | >>> parent_team = factory.makeTeam() |
163 | 39 | >>> child_team = factory.makeTeam(name='child-team') | 39 | >>> child_team = factory.makeTeam(name='child-team') |
164 | 40 | >>> random_team = factory.makeTeam() | 40 | >>> random_team = factory.makeTeam() |
166 | 41 | >>> parent_team.addMember( | 41 | >>> ignored = parent_team.addMember( |
167 | 42 | ... child_team, reviewer=parent_team.teamowner, force_team_add=True) | 42 | ... child_team, reviewer=parent_team.teamowner, force_team_add=True) |
168 | 43 | >>> form = {'field.dupe_person': child_team.name, | 43 | >>> form = {'field.dupe_person': child_team.name, |
169 | 44 | ... 'field.target_person': random_team.name, | 44 | ... 'field.target_person': random_team.name, |
170 | 45 | 45 | ||
171 | === modified file 'lib/lp/registry/browser/tests/person-views.txt' | |||
172 | --- lib/lp/registry/browser/tests/person-views.txt 2009-12-23 16:17:12 +0000 | |||
173 | +++ lib/lp/registry/browser/tests/person-views.txt 2010-01-05 17:55:34 +0000 | |||
174 | @@ -911,7 +911,7 @@ | |||
175 | 911 | 911 | ||
176 | 912 | >>> login("admin@canonical.com") | 912 | >>> login("admin@canonical.com") |
177 | 913 | >>> team = factory.makeTeam() | 913 | >>> team = factory.makeTeam() |
179 | 914 | >>> team.addMember(sample_person, sample_person) | 914 | >>> ignored = team.addMember(sample_person, sample_person) |
180 | 915 | >>> ppa = factory.makeArchive(distribution=ubuntu, owner=team) | 915 | >>> ppa = factory.makeArchive(distribution=ubuntu, owner=team) |
181 | 916 | 916 | ||
182 | 917 | >>> login(ANONYMOUS) | 917 | >>> login(ANONYMOUS) |
183 | 918 | 918 | ||
184 | === modified file 'lib/lp/registry/browser/tests/product-views.txt' | |||
185 | --- lib/lp/registry/browser/tests/product-views.txt 2009-11-23 14:52:25 +0000 | |||
186 | +++ lib/lp/registry/browser/tests/product-views.txt 2010-01-05 17:55:34 +0000 | |||
187 | @@ -142,7 +142,7 @@ | |||
188 | 142 | >>> commercial_member = getUtility(IPersonSet).getByEmail( | 142 | >>> commercial_member = getUtility(IPersonSet).getByEmail( |
189 | 143 | ... 'commercial-member@canonical.com') | 143 | ... 'commercial-member@canonical.com') |
190 | 144 | >>> registry_experts = getUtility(IPersonSet).getByName('registry') | 144 | >>> registry_experts = getUtility(IPersonSet).getByName('registry') |
192 | 145 | >>> registry_experts.addMember(commercial_member, reviewer=mark) | 145 | >>> ignored = registry_experts.addMember(commercial_member, reviewer=mark) |
193 | 146 | >>> login('commercial-member@canonical.com') | 146 | >>> login('commercial-member@canonical.com') |
194 | 147 | >>> view = create_initialized_view(firefox, name='+review-license') | 147 | >>> view = create_initialized_view(firefox, name='+review-license') |
195 | 148 | >>> print view.label | 148 | >>> print view.label |
196 | 149 | 149 | ||
197 | === modified file 'lib/lp/registry/browser/tests/projectgroupset-views.txt' | |||
198 | --- lib/lp/registry/browser/tests/projectgroupset-views.txt 2009-09-12 06:00:05 +0000 | |||
199 | +++ lib/lp/registry/browser/tests/projectgroupset-views.txt 2010-01-05 17:55:34 +0000 | |||
200 | @@ -44,7 +44,7 @@ | |||
201 | 44 | 44 | ||
202 | 45 | >>> registry_member = factory.makePerson() | 45 | >>> registry_member = factory.makePerson() |
203 | 46 | >>> login('foo.bar@canonical.com') | 46 | >>> login('foo.bar@canonical.com') |
205 | 47 | >>> registry.addMember(registry_member, registry.teamowner) | 47 | >>> ignored = registry.addMember(registry_member, registry.teamowner) |
206 | 48 | >>> registry_member.inTeam(registry) | 48 | >>> registry_member.inTeam(registry) |
207 | 49 | True | 49 | True |
208 | 50 | 50 | ||
209 | 51 | 51 | ||
210 | === modified file 'lib/lp/registry/browser/tests/team-views.txt' | |||
211 | --- lib/lp/registry/browser/tests/team-views.txt 2009-11-25 23:20:08 +0000 | |||
212 | +++ lib/lp/registry/browser/tests/team-views.txt 2010-01-05 17:55:34 +0000 | |||
213 | @@ -33,7 +33,7 @@ | |||
214 | 33 | >>> salgado = person_set.getByName('salgado') | 33 | >>> salgado = person_set.getByName('salgado') |
215 | 34 | >>> mark = person_set.getByName('mark') | 34 | >>> mark = person_set.getByName('mark') |
216 | 35 | >>> login('foo.bar@canonical.com') | 35 | >>> login('foo.bar@canonical.com') |
218 | 36 | >>> ubuntu_team.addMember(salgado, reviewer=mark) | 36 | >>> ignored = ubuntu_team.addMember(salgado, reviewer=mark) |
219 | 37 | 37 | ||
220 | 38 | >>> team_home = create_initialized_view(ubuntu_team, '+index') | 38 | >>> team_home = create_initialized_view(ubuntu_team, '+index') |
221 | 39 | >>> for member in team_home.recently_approved_members: | 39 | >>> for member in team_home.recently_approved_members: |
222 | @@ -125,7 +125,7 @@ | |||
223 | 125 | 125 | ||
224 | 126 | >>> london_member = factory.makePerson( | 126 | >>> london_member = factory.makePerson( |
225 | 127 | ... latitude=51.49, longitude=-0.13, time_zone='Europe/London') | 127 | ... latitude=51.49, longitude=-0.13, time_zone='Europe/London') |
227 | 128 | >>> context.addMember(london_member, mark) | 128 | >>> ignored = context.addMember(london_member, mark) |
228 | 129 | >>> context.mapped_participants_count | 129 | >>> context.mapped_participants_count |
229 | 130 | 1 | 130 | 1 |
230 | 131 | >>> view = create_initialized_view(context, '+map') | 131 | >>> view = create_initialized_view(context, '+map') |
231 | @@ -139,7 +139,7 @@ | |||
232 | 139 | 139 | ||
233 | 140 | >>> brazil_member = factory.makePerson( | 140 | >>> brazil_member = factory.makePerson( |
234 | 141 | ... latitude=-23.60, longitude=-46.64, time_zone='America/Sao_Paulo') | 141 | ... latitude=-23.60, longitude=-46.64, time_zone='America/Sao_Paulo') |
236 | 142 | >>> context.addMember(brazil_member, mark) | 142 | >>> ignored = context.addMember(brazil_member, mark) |
237 | 143 | >>> context.mapped_participants_count | 143 | >>> context.mapped_participants_count |
238 | 144 | 2 | 144 | 2 |
239 | 145 | >>> view = create_initialized_view(context, '+map') | 145 | >>> view = create_initialized_view(context, '+map') |
240 | @@ -153,7 +153,7 @@ | |||
241 | 153 | 153 | ||
242 | 154 | >>> london_member2 = factory.makePerson( | 154 | >>> london_member2 = factory.makePerson( |
243 | 155 | ... latitude=51.49, longitude=-0.13, time_zone='Europe/London') | 155 | ... latitude=51.49, longitude=-0.13, time_zone='Europe/London') |
245 | 156 | >>> context.addMember(london_member2, mark) | 156 | >>> ignored = context.addMember(london_member2, mark) |
246 | 157 | >>> context.mapped_participants_count | 157 | >>> context.mapped_participants_count |
247 | 158 | 3 | 158 | 3 |
248 | 159 | >>> view = create_initialized_view(context, '+map') | 159 | >>> view = create_initialized_view(context, '+map') |
249 | 160 | 160 | ||
250 | === modified file 'lib/lp/registry/browser/tests/teammembership-views.txt' | |||
251 | --- lib/lp/registry/browser/tests/teammembership-views.txt 2010-01-05 17:55:30 +0000 | |||
252 | +++ lib/lp/registry/browser/tests/teammembership-views.txt 2010-01-05 17:55:34 +0000 | |||
253 | @@ -62,8 +62,7 @@ | |||
254 | 62 | >>> from lp.registry.browser.person import TeamInvitationView | 62 | >>> from lp.registry.browser.person import TeamInvitationView |
255 | 63 | 63 | ||
256 | 64 | >>> login_person(team_owner) | 64 | >>> login_person(team_owner) |
259 | 65 | >>> super_team.addMember(team, team_owner) | 65 | >>> ignored = super_team.addMember(team, team_owner) |
258 | 66 | True | ||
260 | 67 | >>> membership = membership_set.getByPersonAndTeam(team, super_team) | 66 | >>> membership = membership_set.getByPersonAndTeam(team, super_team) |
261 | 68 | >>> login_person(team.teamowner) | 67 | >>> login_person(team.teamowner) |
262 | 69 | >>> view = TeamInvitationView(membership, request) | 68 | >>> view = TeamInvitationView(membership, request) |
263 | 70 | 69 | ||
264 | === modified file 'lib/lp/registry/doc/announcement.txt' | |||
265 | --- lib/lp/registry/doc/announcement.txt 2009-08-13 19:03:36 +0000 | |||
266 | +++ lib/lp/registry/doc/announcement.txt 2010-01-05 17:55:34 +0000 | |||
267 | @@ -32,7 +32,7 @@ | |||
268 | 32 | >>> login('foo.bar@canonical.com') | 32 | >>> login('foo.bar@canonical.com') |
269 | 33 | >>> from canonical.launchpad.interfaces import ILaunchpadCelebrities | 33 | >>> from canonical.launchpad.interfaces import ILaunchpadCelebrities |
270 | 34 | >>> beta = getUtility(ILaunchpadCelebrities).launchpad_beta_testers | 34 | >>> beta = getUtility(ILaunchpadCelebrities).launchpad_beta_testers |
272 | 35 | >>> beta.addMember(mark, mark) | 35 | >>> ignored = beta.addMember(mark, mark) |
273 | 36 | >>> from canonical.database.sqlbase import flush_database_updates | 36 | >>> from canonical.database.sqlbase import flush_database_updates |
274 | 37 | >>> flush_database_updates() | 37 | >>> flush_database_updates() |
275 | 38 | >>> logout() | 38 | >>> logout() |
276 | 39 | 39 | ||
277 | === modified file 'lib/lp/registry/doc/commercialsubscription.txt' | |||
278 | --- lib/lp/registry/doc/commercialsubscription.txt 2009-09-16 20:08:36 +0000 | |||
279 | +++ lib/lp/registry/doc/commercialsubscription.txt 2010-01-05 17:55:34 +0000 | |||
280 | @@ -550,7 +550,7 @@ | |||
281 | 550 | >>> registry_member = factory.makePerson() | 550 | >>> registry_member = factory.makePerson() |
282 | 551 | >>> celebs = getUtility(ILaunchpadCelebrities) | 551 | >>> celebs = getUtility(ILaunchpadCelebrities) |
283 | 552 | >>> registry = celebs.registry_experts | 552 | >>> registry = celebs.registry_experts |
285 | 553 | >>> registry.addMember(registry_member, registry.teamowner) | 553 | >>> ignored = registry.addMember(registry_member, registry.teamowner) |
286 | 554 | >>> logout() | 554 | >>> logout() |
287 | 555 | 555 | ||
288 | 556 | >>> login_person(registry_member) | 556 | >>> login_person(registry_member) |
289 | 557 | 557 | ||
290 | === modified file 'lib/lp/registry/doc/mailinglist-email-notification.txt' | |||
291 | --- lib/lp/registry/doc/mailinglist-email-notification.txt 2009-05-12 08:11:06 +0000 | |||
292 | +++ lib/lp/registry/doc/mailinglist-email-notification.txt 2010-01-05 17:55:34 +0000 | |||
293 | @@ -10,7 +10,7 @@ | |||
294 | 10 | >>> salgado = getUtility(IPersonSet).getByName('salgado') | 10 | >>> salgado = getUtility(IPersonSet).getByName('salgado') |
295 | 11 | 11 | ||
296 | 12 | >>> from lp.registry.tests.mailinglists_helper import ( | 12 | >>> from lp.registry.tests.mailinglists_helper import ( |
298 | 13 | ... new_team, new_list_for_team) | 13 | ... new_team, new_list_for_team) |
299 | 14 | 14 | ||
300 | 15 | # login() as an admin so that we can call IPerson.join() on any | 15 | # login() as an admin so that we can call IPerson.join() on any |
301 | 16 | # person/team we want. | 16 | # person/team we want. |
302 | @@ -33,7 +33,8 @@ | |||
303 | 33 | >>> list_one.status.name | 33 | >>> list_one.status.name |
304 | 34 | 'ACTIVE' | 34 | 'ACTIVE' |
305 | 35 | 35 | ||
307 | 36 | >>> transaction.commit() # Send the emails. | 36 | # Send the emails. |
308 | 37 | >>> transaction.commit() | ||
309 | 37 | 38 | ||
310 | 38 | Both Anne and No Privileges Person receive the notifications, Anne as a | 39 | Both Anne and No Privileges Person receive the notifications, Anne as a |
311 | 39 | newly subscribed member and No Privileges Person as the owner of the | 40 | newly subscribed member and No Privileges Person as the owner of the |
312 | @@ -89,7 +90,7 @@ | |||
313 | 89 | 90 | ||
314 | 90 | >>> super_team = new_team('super-team', with_list=False) | 91 | >>> super_team = new_team('super-team', with_list=False) |
315 | 91 | >>> sub_team = new_team('sub-team', with_list=False) | 92 | >>> sub_team = new_team('sub-team', with_list=False) |
317 | 92 | >>> super_team.addMember(sub_team, salgado, force_team_add=True) | 93 | >>> ignored = super_team.addMember(sub_team, salgado, force_team_add=True) |
318 | 93 | >>> anne.join(super_team) | 94 | >>> anne.join(super_team) |
319 | 94 | >>> lars = factory.makePersonByName('Lars') | 95 | >>> lars = factory.makePersonByName('Lars') |
320 | 95 | >>> lars.join(sub_team) | 96 | >>> lars.join(sub_team) |
321 | @@ -120,7 +121,8 @@ | |||
322 | 120 | >>> super_list.status.name | 121 | >>> super_list.status.name |
323 | 121 | 'ACTIVE' | 122 | 'ACTIVE' |
324 | 122 | 123 | ||
326 | 123 | >>> transaction.commit() # Send the emails. | 124 | # Send the emails. |
327 | 125 | >>> transaction.commit() | ||
328 | 124 | >>> len(stub.test_emails) | 126 | >>> len(stub.test_emails) |
329 | 125 | 4 | 127 | 4 |
330 | 126 | >>> print_emails(include_reply_to=True) | 128 | >>> print_emails(include_reply_to=True) |
331 | @@ -220,6 +222,7 @@ | |||
332 | 220 | >>> renewed_list.status.name | 222 | >>> renewed_list.status.name |
333 | 221 | 'ACTIVE' | 223 | 'ACTIVE' |
334 | 222 | 224 | ||
336 | 223 | >>> transaction.commit() # Send any outstanding emails. | 225 | # Send any outstanding emails. |
337 | 226 | >>> transaction.commit() | ||
338 | 224 | >>> len(stub.test_emails) | 227 | >>> len(stub.test_emails) |
339 | 225 | 0 | 228 | 0 |
340 | 226 | 229 | ||
341 | === modified file 'lib/lp/registry/doc/mailinglist-subscriptions.txt' | |||
342 | --- lib/lp/registry/doc/mailinglist-subscriptions.txt 2009-05-06 15:13:39 +0000 | |||
343 | +++ lib/lp/registry/doc/mailinglist-subscriptions.txt 2010-01-05 17:55:34 +0000 | |||
344 | @@ -293,7 +293,7 @@ | |||
345 | 293 | ... 'sub-team', team_owner) | 293 | ... 'sub-team', team_owner) |
346 | 294 | >>> team_names.extend((super_team.name, sub_team.name)) | 294 | >>> team_names.extend((super_team.name, sub_team.name)) |
347 | 295 | 295 | ||
349 | 296 | >>> super_team.addMember(sub_team, salgado, force_team_add=True) | 296 | >>> ignored = super_team.addMember(sub_team, salgado, force_team_add=True) |
350 | 297 | >>> lars = factory.makePersonByName('Lars') | 297 | >>> lars = factory.makePersonByName('Lars') |
351 | 298 | >>> lars.join(super_team) | 298 | >>> lars.join(super_team) |
352 | 299 | >>> lars.join(sub_team) | 299 | >>> lars.join(sub_team) |
353 | @@ -333,7 +333,7 @@ | |||
354 | 333 | ... 'team-three', team_owner) | 333 | ... 'team-three', team_owner) |
355 | 334 | >>> team_names.append(team_three.name) | 334 | >>> team_names.append(team_three.name) |
356 | 335 | 335 | ||
358 | 336 | >>> team_one.addMember(team_three, salgado, force_team_add=True) | 336 | >>> ignored = team_one.addMember(team_three, salgado, force_team_add=True) |
359 | 337 | >>> dirk = factory.makePersonByName('Dirk') | 337 | >>> dirk = factory.makePersonByName('Dirk') |
360 | 338 | >>> dirk.join(team_two) | 338 | >>> dirk.join(team_two) |
361 | 339 | >>> dirk.join(team_three) | 339 | >>> dirk.join(team_three) |
362 | @@ -714,7 +714,7 @@ | |||
363 | 714 | >>> team_five = factory.makeTeam(name='team-five', owner=team_owner) | 714 | >>> team_five = factory.makeTeam(name='team-five', owner=team_owner) |
364 | 715 | >>> team_names.append(team_five.name) | 715 | >>> team_names.append(team_five.name) |
365 | 716 | 716 | ||
367 | 717 | >>> team_one.addMember(team_five, salgado, force_team_add=True) | 717 | >>> ignored = team_one.addMember(team_five, salgado, force_team_add=True) |
368 | 718 | >>> gwen = factory.makePersonByName('Gwen') | 718 | >>> gwen = factory.makePersonByName('Gwen') |
369 | 719 | >>> hank = factory.makePersonByName('Hank') | 719 | >>> hank = factory.makePersonByName('Hank') |
370 | 720 | >>> iona = factory.makePersonByName('Iona') | 720 | >>> iona = factory.makePersonByName('Iona') |
371 | 721 | 721 | ||
372 | === modified file 'lib/lp/registry/doc/mailinglists.txt' | |||
373 | --- lib/lp/registry/doc/mailinglists.txt 2009-12-03 20:28:54 +0000 | |||
374 | +++ lib/lp/registry/doc/mailinglists.txt 2010-01-05 17:55:34 +0000 | |||
375 | @@ -82,7 +82,8 @@ | |||
376 | 82 | >>> from canonical.launchpad.interfaces import TeamMembershipStatus | 82 | >>> from canonical.launchpad.interfaces import TeamMembershipStatus |
377 | 83 | >>> login('foo.bar@canonical.com') | 83 | >>> login('foo.bar@canonical.com') |
378 | 84 | >>> bart = factory.makePersonByName('Bart') | 84 | >>> bart = factory.makePersonByName('Bart') |
380 | 85 | >>> team_two.addMember(anne, bart, status=TeamMembershipStatus.ADMIN) | 85 | >>> ignored = team_two.addMember( |
381 | 86 | ... anne, bart, status=TeamMembershipStatus.ADMIN) | ||
382 | 86 | >>> login(ANONYMOUS) | 87 | >>> login(ANONYMOUS) |
383 | 87 | >>> list_two = list_set.new(team_two, anne) | 88 | >>> list_two = list_set.new(team_two, anne) |
384 | 88 | >>> list_two | 89 | >>> list_two |
385 | 89 | 90 | ||
386 | === modified file 'lib/lp/registry/doc/person-merge.txt' | |||
387 | --- lib/lp/registry/doc/person-merge.txt 2009-12-07 16:07:43 +0000 | |||
388 | +++ lib/lp/registry/doc/person-merge.txt 2010-01-05 17:55:34 +0000 | |||
389 | @@ -42,9 +42,9 @@ | |||
390 | 42 | >>> ubuntu_team.teamowner = marilize | 42 | >>> ubuntu_team.teamowner = marilize |
391 | 43 | 43 | ||
392 | 44 | >>> ubuntu_translators = personset.getByName('ubuntu-translators') | 44 | >>> ubuntu_translators = personset.getByName('ubuntu-translators') |
394 | 45 | >>> ubuntu_translators.addMember(marilize, marilize) | 45 | >>> ignored = ubuntu_translators.addMember(marilize, marilize) |
395 | 46 | >>> rosetta_admins = personset.getByName('rosetta-admins') | 46 | >>> rosetta_admins = personset.getByName('rosetta-admins') |
397 | 47 | >>> rosetta_admins.addMember(marilize, marilize) | 47 | >>> ignored = rosetta_admins.addMember(marilize, marilize) |
398 | 48 | 48 | ||
399 | 49 | Karma gets reassigned to the person we merge into. Let's assign karma to | 49 | Karma gets reassigned to the person we merge into. Let's assign karma to |
400 | 50 | Marilize and save it for later comparison. | 50 | Marilize and save it for later comparison. |
401 | @@ -348,7 +348,7 @@ | |||
402 | 348 | >>> from canonical.launchpad.interfaces import IPollSubset, PollSecrecy | 348 | >>> from canonical.launchpad.interfaces import IPollSubset, PollSecrecy |
403 | 349 | >>> test_team = personset.newTeam(sample, 'test-team', 'Test team') | 349 | >>> test_team = personset.newTeam(sample, 'test-team', 'Test team') |
404 | 350 | >>> launchpad_devs = personset.getByName('launchpad') | 350 | >>> launchpad_devs = personset.getByName('launchpad') |
406 | 351 | >>> launchpad_devs.addMember( | 351 | >>> ignored = launchpad_devs.addMember( |
407 | 352 | ... test_team, reviewer=launchpad_devs.teamowner, force_team_add=True) | 352 | ... test_team, reviewer=launchpad_devs.teamowner, force_team_add=True) |
408 | 353 | >>> today = datetime.now(pytz.timezone('UTC')) | 353 | >>> today = datetime.now(pytz.timezone('UTC')) |
409 | 354 | >>> tomorrow = today + timedelta(days=1) | 354 | >>> tomorrow = today + timedelta(days=1) |
410 | 355 | 355 | ||
411 | === modified file 'lib/lp/registry/doc/person.txt' | |||
412 | --- lib/lp/registry/doc/person.txt 2009-12-03 20:00:43 +0000 | |||
413 | +++ lib/lp/registry/doc/person.txt 2010-01-05 17:55:34 +0000 | |||
414 | @@ -482,7 +482,7 @@ | |||
415 | 482 | And we can even add other members to our new team! | 482 | And we can even add other members to our new team! |
416 | 483 | 483 | ||
417 | 484 | >>> login('foo.bar@canonical.com') | 484 | >>> login('foo.bar@canonical.com') |
419 | 485 | >>> not_a_person.addMember(lifeless, reviewer=ddaa) | 485 | >>> ignored = not_a_person.addMember(lifeless, reviewer=ddaa) |
420 | 486 | >>> login(ANONYMOUS) | 486 | >>> login(ANONYMOUS) |
421 | 487 | >>> [member.name for member in not_a_person.activemembers] | 487 | >>> [member.name for member in not_a_person.activemembers] |
422 | 488 | [u'ddaa', u'lifeless'] | 488 | [u'ddaa', u'lifeless'] |
423 | @@ -1125,7 +1125,7 @@ | |||
424 | 1125 | >>> registry_member = factory.makePerson() | 1125 | >>> registry_member = factory.makePerson() |
425 | 1126 | >>> celebs = getUtility(ILaunchpadCelebrities) | 1126 | >>> celebs = getUtility(ILaunchpadCelebrities) |
426 | 1127 | >>> registry = celebs.registry_experts | 1127 | >>> registry = celebs.registry_experts |
428 | 1128 | >>> registry.addMember(registry_member, registry.teamowner) | 1128 | >>> ignored = registry.addMember(registry_member, registry.teamowner) |
429 | 1129 | >>> logout() | 1129 | >>> logout() |
430 | 1130 | 1130 | ||
431 | 1131 | >>> login_person(registry_member) | 1131 | >>> login_person(registry_member) |
432 | 1132 | 1132 | ||
433 | === modified file 'lib/lp/registry/doc/private-team-visibility.txt' | |||
434 | --- lib/lp/registry/doc/private-team-visibility.txt 2010-01-04 23:17:19 +0000 | |||
435 | +++ lib/lp/registry/doc/private-team-visibility.txt 2010-01-05 17:55:34 +0000 | |||
436 | @@ -17,7 +17,7 @@ | |||
437 | 17 | >>> priv_team = factory.makeTeam(owner=priv_owner, name="priv-team", | 17 | >>> priv_team = factory.makeTeam(owner=priv_owner, name="priv-team", |
438 | 18 | ... visibility=PersonVisibility.PRIVATE) | 18 | ... visibility=PersonVisibility.PRIVATE) |
439 | 19 | >>> login_person(priv_owner) | 19 | >>> login_person(priv_owner) |
441 | 20 | >>> priv_team.addMember(priv_member, reviewer=priv_owner) | 20 | >>> ignored = priv_team.addMember(priv_member, reviewer=priv_owner) |
442 | 21 | 21 | ||
443 | 22 | The team owner can see the membership. | 22 | The team owner can see the membership. |
444 | 23 | 23 | ||
445 | @@ -57,7 +57,7 @@ | |||
446 | 57 | >>> pub_member = factory.makePerson(name="pub-member") | 57 | >>> pub_member = factory.makePerson(name="pub-member") |
447 | 58 | >>> pub_team = factory.makeTeam(owner=pub_owner, name="pubteam") | 58 | >>> pub_team = factory.makeTeam(owner=pub_owner, name="pubteam") |
448 | 59 | >>> login_person(pub_owner) | 59 | >>> login_person(pub_owner) |
450 | 60 | >>> pub_team.addMember(pub_member, reviewer=pub_owner) | 60 | >>> ignored = pub_team.addMember(pub_member, reviewer=pub_owner) |
451 | 61 | 61 | ||
452 | 62 | At this point the public team owner cannot see the priv-team's bits. | 62 | At this point the public team owner cannot see the priv-team's bits. |
453 | 63 | 63 | ||
454 | @@ -67,7 +67,7 @@ | |||
455 | 67 | Unauthorized: (<Person at ... priv-team (Priv Team)>, 'name', 'launchpad.View') | 67 | Unauthorized: (<Person at ... priv-team (Priv Team)>, 'name', 'launchpad.View') |
456 | 68 | 68 | ||
457 | 69 | >>> login_person(priv_owner) | 69 | >>> login_person(priv_owner) |
459 | 70 | >>> priv_team.addMember(pub_team, reviewer=priv_owner) | 70 | >>> ignored = priv_team.addMember(pub_team, reviewer=priv_owner) |
460 | 71 | 71 | ||
461 | 72 | The public team is not yet a member of the priv-team. | 72 | The public team is not yet a member of the priv-team. |
462 | 73 | 73 | ||
463 | 74 | 74 | ||
464 | === modified file 'lib/lp/registry/doc/teammembership-email-notification.txt' | |||
465 | --- lib/lp/registry/doc/teammembership-email-notification.txt 2010-01-05 17:55:30 +0000 | |||
466 | +++ lib/lp/registry/doc/teammembership-email-notification.txt 2010-01-05 17:55:34 +0000 | |||
467 | @@ -227,8 +227,7 @@ | |||
468 | 227 | 227 | ||
469 | 228 | >>> cprov = personset.getByName('cprov') | 228 | >>> cprov = personset.getByName('cprov') |
470 | 229 | >>> marilize = personset.getByName('marilize') | 229 | >>> marilize = personset.getByName('marilize') |
473 | 230 | >>> ubuntu_team.addMember(marilize, reviewer=cprov) | 230 | >>> ignored = ubuntu_team.addMember(marilize, reviewer=cprov) |
472 | 231 | True | ||
474 | 232 | >>> transaction.commit() | 231 | >>> transaction.commit() |
475 | 233 | >>> len(stub.test_emails) | 232 | >>> len(stub.test_emails) |
476 | 234 | 6 | 233 | 6 |
477 | @@ -277,8 +276,7 @@ | |||
478 | 277 | >>> mirror_admins = personset.getByName('ubuntu-mirror-admins') | 276 | >>> mirror_admins = personset.getByName('ubuntu-mirror-admins') |
479 | 278 | >>> mirror_admins.getTeamAdminsEmailAddresses() | 277 | >>> mirror_admins.getTeamAdminsEmailAddresses() |
480 | 279 | ['mark@example.com'] | 278 | ['mark@example.com'] |
483 | 280 | >>> ubuntu_team.addMember(mirror_admins, reviewer=cprov) | 279 | >>> ignored = ubuntu_team.addMember(mirror_admins, reviewer=cprov) |
482 | 281 | True | ||
484 | 282 | >>> transaction.commit() | 280 | >>> transaction.commit() |
485 | 283 | >>> len(stub.test_emails) | 281 | >>> len(stub.test_emails) |
486 | 284 | 1 | 282 | 1 |
487 | @@ -329,8 +327,7 @@ | |||
488 | 329 | Similarly, a notification is sent if the invitation is declined. | 327 | Similarly, a notification is sent if the invitation is declined. |
489 | 330 | 328 | ||
490 | 331 | >>> landscape = personset.getByName('landscape-developers') | 329 | >>> landscape = personset.getByName('landscape-developers') |
493 | 332 | >>> ubuntu_team.addMember(landscape, reviewer=cprov) | 330 | >>> ignored = ubuntu_team.addMember(landscape, reviewer=cprov) |
492 | 333 | True | ||
494 | 334 | 331 | ||
495 | 335 | # Reset stub.test_emails as we don't care about the notification triggered | 332 | # Reset stub.test_emails as we don't care about the notification triggered |
496 | 336 | # by the addMember() call. | 333 | # by the addMember() call. |
497 | @@ -363,8 +360,8 @@ | |||
498 | 363 | passing force_team_add=True to the addMember() method. | 360 | passing force_team_add=True to the addMember() method. |
499 | 364 | 361 | ||
500 | 365 | >>> launchpad = personset.getByName('launchpad') | 362 | >>> launchpad = personset.getByName('launchpad') |
503 | 366 | >>> ubuntu_team.addMember(launchpad, reviewer=cprov, force_team_add=True) | 363 | >>> ignored = ubuntu_team.addMember( |
504 | 367 | True | 364 | ... launchpad, reviewer=cprov, force_team_add=True) |
505 | 368 | >>> flush_database_updates() | 365 | >>> flush_database_updates() |
506 | 369 | >>> transaction.commit() | 366 | >>> transaction.commit() |
507 | 370 | >>> len(stub.test_emails) | 367 | >>> len(stub.test_emails) |
508 | @@ -854,8 +851,7 @@ | |||
509 | 854 | >>> dummy = pop_notifications() | 851 | >>> dummy = pop_notifications() |
510 | 855 | >>> member = factory.makePerson( | 852 | >>> member = factory.makePerson( |
511 | 856 | ... name='team-member', email='team-member@example.com') | 853 | ... name='team-member', email='team-member@example.com') |
514 | 857 | >>> team_one.addMember(member, owner) | 854 | >>> ignored = team_one.addMember(member, owner) |
513 | 858 | True | ||
515 | 859 | >>> print_distinct_emails() | 855 | >>> print_distinct_emails() |
516 | 860 | From: Team One ... | 856 | From: Team One ... |
517 | 861 | ---------------------------------------- | 857 | ---------------------------------------- |
518 | @@ -881,8 +877,7 @@ | |||
519 | 881 | 877 | ||
520 | 882 | >>> team_two = factory.makeTeam( | 878 | >>> team_two = factory.makeTeam( |
521 | 883 | ... name='team-two', email='team-two@example.com', owner=owner) | 879 | ... name='team-two', email='team-two@example.com', owner=owner) |
524 | 884 | >>> team_one.addMember(team_two, owner, force_team_add=True) | 880 | >>> ignored = team_one.addMember(team_two, owner, force_team_add=True) |
523 | 885 | True | ||
525 | 886 | >>> print_distinct_emails() | 881 | >>> print_distinct_emails() |
526 | 887 | From: Team One ... | 882 | From: Team One ... |
527 | 888 | ---------------------------------------- | 883 | ---------------------------------------- |
528 | 889 | 884 | ||
529 | === modified file 'lib/lp/registry/doc/teammembership.txt' | |||
530 | --- lib/lp/registry/doc/teammembership.txt 2010-01-05 17:55:30 +0000 | |||
531 | +++ lib/lp/registry/doc/teammembership.txt 2010-01-05 17:55:34 +0000 | |||
532 | @@ -22,23 +22,28 @@ | |||
533 | 22 | >>> from zope.component import getUtility | 22 | >>> from zope.component import getUtility |
534 | 23 | >>> from canonical.launchpad.interfaces import IPersonSet | 23 | >>> from canonical.launchpad.interfaces import IPersonSet |
535 | 24 | >>> personset = getUtility(IPersonSet) | 24 | >>> personset = getUtility(IPersonSet) |
538 | 25 | >>> foobar = personset.getByName('name16') | 25 | >>> jblack = personset.getByName('jblack') |
539 | 26 | >>> reviewer = foobar | 26 | >>> nopriv = personset.getByName('no-priv') |
540 | 27 | >>> jdub = personset.getByName('jdub') | ||
541 | 28 | >>> reviewer = nopriv | ||
542 | 27 | >>> t1 = personset.newTeam( | 29 | >>> t1 = personset.newTeam( |
544 | 28 | ... foobar, 't1', 't1', | 30 | ... jblack, 't1', 't1', |
545 | 29 | ... subscriptionpolicy=TeamSubscriptionPolicy.OPEN) | 31 | ... subscriptionpolicy=TeamSubscriptionPolicy.OPEN) |
546 | 30 | >>> t2 = personset.newTeam( | 32 | >>> t2 = personset.newTeam( |
548 | 31 | ... foobar, 't2', 't2', | 33 | ... nopriv, 't2', 't2', |
549 | 32 | ... subscriptionpolicy=TeamSubscriptionPolicy.OPEN) | 34 | ... subscriptionpolicy=TeamSubscriptionPolicy.OPEN) |
550 | 33 | >>> t3 = personset.newTeam( | 35 | >>> t3 = personset.newTeam( |
552 | 34 | ... foobar, 't3', 't3', | 36 | ... jdub, 't3', 't3', |
553 | 35 | ... subscriptionpolicy=TeamSubscriptionPolicy.MODERATED) | 37 | ... subscriptionpolicy=TeamSubscriptionPolicy.MODERATED) |
554 | 36 | >>> t4 = personset.newTeam( | 38 | >>> t4 = personset.newTeam( |
556 | 37 | ... foobar, 't4', 't4', | 39 | ... nopriv, 't4', 't4', |
557 | 38 | ... subscriptionpolicy=TeamSubscriptionPolicy.OPEN) | 40 | ... subscriptionpolicy=TeamSubscriptionPolicy.OPEN) |
558 | 39 | >>> t5 = personset.newTeam( | 41 | >>> t5 = personset.newTeam( |
560 | 40 | ... foobar, 't5', 't5', | 42 | ... nopriv, 't5', 't5', |
561 | 41 | ... subscriptionpolicy=TeamSubscriptionPolicy.OPEN) | 43 | ... subscriptionpolicy=TeamSubscriptionPolicy.OPEN) |
562 | 44 | >>> t6 = personset.newTeam( | ||
563 | 45 | ... jdub, 't6', 't6', | ||
564 | 46 | ... subscriptionpolicy=TeamSubscriptionPolicy.MODERATED) | ||
565 | 42 | 47 | ||
566 | 43 | # Make sure the teams have predictable (and different) creation dates as | 48 | # Make sure the teams have predictable (and different) creation dates as |
567 | 44 | # some of our tests depend on that. | 49 | # some of our tests depend on that. |
568 | @@ -66,15 +71,15 @@ | |||
569 | 66 | member of that team --somebody has to approve his membership first: | 71 | member of that team --somebody has to approve his membership first: |
570 | 67 | 72 | ||
571 | 68 | >>> [m.displayname for m in t4.allmembers] | 73 | >>> [m.displayname for m in t4.allmembers] |
573 | 69 | [u'Foo Bar', u'Guilherme Salgado'] | 74 | [u'Guilherme Salgado', u'No Privileges Person'] |
574 | 70 | 75 | ||
575 | 71 | >>> [m.displayname for m in t3.allmembers] | 76 | >>> [m.displayname for m in t3.allmembers] |
577 | 72 | [u'Foo Bar'] | 77 | [u'Jeff Waugh'] |
578 | 73 | >>> login_person(t3.teamowner) | 78 | >>> login_person(t3.teamowner) |
579 | 74 | >>> t3.setMembershipData(salgado, TeamMembershipStatus.APPROVED, reviewer) | 79 | >>> t3.setMembershipData(salgado, TeamMembershipStatus.APPROVED, reviewer) |
580 | 75 | >>> flush_database_updates() | 80 | >>> flush_database_updates() |
581 | 76 | >>> [m.displayname for m in t3.allmembers] | 81 | >>> [m.displayname for m in t3.allmembers] |
583 | 77 | [u'Foo Bar', u'Guilherme Salgado'] | 82 | [u'Guilherme Salgado', u'Jeff Waugh'] |
584 | 78 | 83 | ||
585 | 79 | The join() method is not allowed for teams whose subscription policy is | 84 | The join() method is not allowed for teams whose subscription policy is |
586 | 80 | RESTRICTED. And it'll be a no-op in case the user has already joined the | 85 | RESTRICTED. And it'll be a no-op in case the user has already joined the |
587 | @@ -141,12 +146,12 @@ | |||
588 | 141 | # Log in as the team owner. | 146 | # Log in as the team owner. |
589 | 142 | >>> login_person(t3.teamowner) | 147 | >>> login_person(t3.teamowner) |
590 | 143 | 148 | ||
593 | 144 | addMember returns True if the member got added (i.e. he wasn't already a | 149 | If the member was added (i.e. he wasn't already a member of the team), |
594 | 145 | member of the team). | 150 | addMember returns a tuple with True plus the new membership status. |
595 | 146 | 151 | ||
596 | 147 | >>> t3.addMember( | 152 | >>> t3.addMember( |
597 | 148 | ... salgado, reviewer=mark, status=TeamMembershipStatus.ADMIN) | 153 | ... salgado, reviewer=mark, status=TeamMembershipStatus.ADMIN) |
599 | 149 | True | 154 | (True, <DBItem TeamMembershipStatus.ADMIN...) |
600 | 150 | >>> from canonical.launchpad.interfaces import ITeamMembershipSet | 155 | >>> from canonical.launchpad.interfaces import ITeamMembershipSet |
601 | 151 | >>> membershipset = getUtility(ITeamMembershipSet) | 156 | >>> membershipset = getUtility(ITeamMembershipSet) |
602 | 152 | >>> flush_database_updates() | 157 | >>> flush_database_updates() |
603 | @@ -158,26 +163,26 @@ | |||
604 | 158 | >>> salgado in t3.activemembers | 163 | >>> salgado in t3.activemembers |
605 | 159 | True | 164 | True |
606 | 160 | 165 | ||
609 | 161 | addMember returns True also when the member is added as a proposed | 166 | addMember returns (True, PROPOSED) also when the member is added as a |
610 | 162 | member. | 167 | proposed member. |
611 | 163 | 168 | ||
612 | 164 | >>> marilize = personset.getByName('marilize') | 169 | >>> marilize = personset.getByName('marilize') |
613 | 165 | >>> t3.addMember( | 170 | >>> t3.addMember( |
614 | 166 | ... marilize, reviewer=mark, status=TeamMembershipStatus.PROPOSED) | 171 | ... marilize, reviewer=mark, status=TeamMembershipStatus.PROPOSED) |
616 | 167 | True | 172 | (True, <DBItem TeamMembershipStatus.PROPOSED...) |
617 | 168 | >>> flush_database_updates() | 173 | >>> flush_database_updates() |
618 | 169 | >>> marilize in t3.activemembers | 174 | >>> marilize in t3.activemembers |
619 | 170 | False | 175 | False |
620 | 171 | 176 | ||
621 | 172 | If addMember is called with a person that is already a member, it | 177 | If addMember is called with a person that is already a member, it |
623 | 173 | returns False. | 178 | returns a tuple with False and the current status of the membership. |
624 | 174 | 179 | ||
625 | 175 | >>> t3.addMember( | 180 | >>> t3.addMember( |
626 | 176 | ... salgado, reviewer=mark, status=TeamMembershipStatus.ADMIN) | 181 | ... salgado, reviewer=mark, status=TeamMembershipStatus.ADMIN) |
628 | 177 | False | 182 | (False, <DBItem TeamMembershipStatus.ADMIN...) |
629 | 178 | >>> t3.addMember( | 183 | >>> t3.addMember( |
630 | 179 | ... marilize, reviewer=mark, status=TeamMembershipStatus.PROPOSED) | 184 | ... marilize, reviewer=mark, status=TeamMembershipStatus.PROPOSED) |
632 | 180 | False | 185 | (False, <DBItem TeamMembershipStatus.PROPOSED...) |
633 | 181 | 186 | ||
634 | 182 | As expected, the membership object implements ITeamMembership. | 187 | As expected, the membership object implements ITeamMembership. |
635 | 183 | 188 | ||
636 | @@ -188,29 +193,37 @@ | |||
637 | 188 | 193 | ||
638 | 189 | Note that, by default, the ITeam.addMember() API works slightly different | 194 | Note that, by default, the ITeam.addMember() API works slightly different |
639 | 190 | when the added member is a team. In that case the team will actually be | 195 | when the added member is a team. In that case the team will actually be |
641 | 191 | invited to be a member and one of the team's admins will have to accpet the | 196 | invited to be a member and one of the team's admins will have to accept the |
642 | 192 | invitation before the team is made a member. | 197 | invitation before the team is made a member. |
643 | 193 | 198 | ||
645 | 194 | >>> t1.addMember(t2, reviewer) | 199 | >>> login_person(t1.teamowner) |
646 | 200 | |||
647 | 201 | # If the reviewer were also an admin of the team being added, | ||
648 | 202 | # the status would go to APPROVED instead of INVITED. | ||
649 | 203 | >>> t2.teamowner != t1.teamowner | ||
650 | 195 | True | 204 | True |
651 | 205 | >>> t1.addMember(t2, reviewer=t1.teamowner) | ||
652 | 206 | (True, <DBItem TeamMembershipStatus.INVITED...) | ||
653 | 196 | >>> membership = membershipset.getByPersonAndTeam(t2, t1) | 207 | >>> membership = membershipset.getByPersonAndTeam(t2, t1) |
654 | 197 | >>> membership.status == TeamMembershipStatus.INVITED | 208 | >>> membership.status == TeamMembershipStatus.INVITED |
655 | 198 | True | 209 | True |
656 | 199 | >>> [m.displayname for m in t1.allmembers] | 210 | >>> [m.displayname for m in t1.allmembers] |
658 | 200 | [u'Foo Bar'] | 211 | [u'James Blackwell'] |
659 | 201 | 212 | ||
660 | 202 | Once one of the t2 admins approve the membership, t2 is shown as a member | 213 | Once one of the t2 admins approve the membership, t2 is shown as a member |
662 | 203 | of t1. | 214 | of t1 and the owner of t2 is an indirect member. |
663 | 204 | 215 | ||
664 | 205 | >>> login_person(t2.teamowner) | 216 | >>> login_person(t2.teamowner) |
665 | 206 | >>> t2.acceptInvitationToBeMemberOf(t1, comment='something') | 217 | >>> t2.acceptInvitationToBeMemberOf(t1, comment='something') |
666 | 218 | >>> [m.displayname for m in t1.activemembers] | ||
667 | 219 | [u'James Blackwell', u't2'] | ||
668 | 207 | >>> [m.displayname for m in t1.allmembers] | 220 | >>> [m.displayname for m in t1.allmembers] |
670 | 208 | [u'Foo Bar', u't2'] | 221 | [u'James Blackwell', u'No Privileges Person', u't2'] |
671 | 209 | 222 | ||
672 | 210 | A team admin can also decline an invitation made to his team. | 223 | A team admin can also decline an invitation made to his team. |
673 | 211 | 224 | ||
674 | 212 | >>> t2.addMember(t3, reviewer=mark) | 225 | >>> t2.addMember(t3, reviewer=mark) |
676 | 213 | True | 226 | (True, <DBItem TeamMembershipStatus.INVITED...) |
677 | 214 | >>> login_person(t3.teamowner) | 227 | >>> login_person(t3.teamowner) |
678 | 215 | >>> t3.declineInvitationToBeMemberOf(t2, comment='something') | 228 | >>> t3.declineInvitationToBeMemberOf(t2, comment='something') |
679 | 216 | >>> membership = membershipset.getByPersonAndTeam(t3, t2) | 229 | >>> membership = membershipset.getByPersonAndTeam(t3, t2) |
680 | @@ -222,21 +235,40 @@ | |||
681 | 222 | force_team_add=True to addMember(). We'll use that to add t3 as a member of | 235 | force_team_add=True to addMember(). We'll use that to add t3 as a member of |
682 | 223 | t2, thus making all t3 members be considered members of t2 as well. | 236 | t2, thus making all t3 members be considered members of t2 as well. |
683 | 224 | 237 | ||
686 | 225 | >>> login_person(t3.teamowner) | 238 | >>> login_person(t2.teamowner) |
687 | 226 | >>> t2.addMember(t3, reviewer=mark, force_team_add=True) | 239 | |
688 | 240 | # If the reviewer is also an admin of the team being added, | ||
689 | 241 | # force_team_add is unnecessary, and we can't prove that that | ||
690 | 242 | # argument works. | ||
691 | 243 | >>> t3.teamowner != t2.teamowner | ||
692 | 227 | True | 244 | True |
693 | 245 | >>> t2.addMember(t3, reviewer=t2.teamowner, force_team_add=True) | ||
694 | 246 | (True, <DBItem TeamMembershipStatus.APPROVED...) | ||
695 | 228 | >>> [m.displayname for m in t2.allmembers] | 247 | >>> [m.displayname for m in t2.allmembers] |
697 | 229 | [u'Foo Bar', u'Guilherme Salgado', u't3'] | 248 | [u'Guilherme Salgado', u'Jeff Waugh', u'No Privileges Person', u't3'] |
698 | 230 | 249 | ||
699 | 231 | And members of t1 as well, since t2 is a member of t1. | 250 | And members of t1 as well, since t2 is a member of t1. |
700 | 232 | 251 | ||
701 | 233 | >>> [m.displayname for m in t1.allmembers] | 252 | >>> [m.displayname for m in t1.allmembers] |
703 | 234 | [u'Foo Bar', u'Guilherme Salgado', u't2', u't3'] | 253 | [u'Guilherme Salgado', u'James Blackwell', u'Jeff Waugh', |
704 | 254 | u'No Privileges Person', u't2', u't3'] | ||
705 | 255 | |||
706 | 256 | |||
707 | 257 | Passing in force_team_add=True is not necessary if the reviewer is the | ||
708 | 258 | admin of the team being added. | ||
709 | 259 | |||
710 | 260 | >>> login_person(t3.teamowner) | ||
711 | 261 | >>> t6.addMember(t3, reviewer=t3.teamowner) | ||
712 | 262 | (True, <DBItem TeamMembershipStatus.APPROVED...) | ||
713 | 263 | >>> [m.displayname for m in t6.allmembers] | ||
714 | 264 | [u'Guilherme Salgado', u'Jeff Waugh', u't3'] | ||
715 | 235 | 265 | ||
716 | 236 | Can we add t2 as a member of t3? No, we prevent this kind of loop, and users | 266 | Can we add t2 as a member of t3? No, we prevent this kind of loop, and users |
717 | 237 | can't do this because our vocabularies won't allow members that would cause | 267 | can't do this because our vocabularies won't allow members that would cause |
718 | 238 | loops. | 268 | loops. |
719 | 239 | 269 | ||
720 | 270 | >>> foobar = personset.getByEmail('foo.bar@canonical.com') | ||
721 | 271 | >>> login_person(foobar) | ||
722 | 240 | >>> t3.addMember(t2, reviewer) | 272 | >>> t3.addMember(t2, reviewer) |
723 | 241 | Traceback (most recent call last): | 273 | Traceback (most recent call last): |
724 | 242 | ... | 274 | ... |
725 | @@ -246,19 +278,21 @@ | |||
726 | 246 | Adding t2 as a member of t5 will add all t2 members as t5 members too. | 278 | Adding t2 as a member of t5 will add all t2 members as t5 members too. |
727 | 247 | 279 | ||
728 | 248 | >>> t5.addMember(t2, reviewer, force_team_add=True) | 280 | >>> t5.addMember(t2, reviewer, force_team_add=True) |
730 | 249 | True | 281 | (True, <DBItem TeamMembershipStatus.APPROVED...) |
731 | 250 | >>> [m.displayname for m in t5.allmembers] | 282 | >>> [m.displayname for m in t5.allmembers] |
733 | 251 | [u'Foo Bar', u'Guilherme Salgado', u't2', u't3'] | 283 | [u'Guilherme Salgado', u'Jeff Waugh', u'No Privileges Person', |
734 | 284 | u't2', u't3'] | ||
735 | 252 | 285 | ||
736 | 253 | Adding t5 and t1 as members of t4 will add all t5 and t1 members as t4 | 286 | Adding t5 and t1 as members of t4 will add all t5 and t1 members as t4 |
737 | 254 | members too. | 287 | members too. |
738 | 255 | 288 | ||
739 | 256 | >>> t4.addMember(t5, reviewer, force_team_add=True) | 289 | >>> t4.addMember(t5, reviewer, force_team_add=True) |
741 | 257 | True | 290 | (True, <DBItem TeamMembershipStatus.APPROVED...) |
742 | 258 | >>> t4.addMember(t1, reviewer, force_team_add=True) | 291 | >>> t4.addMember(t1, reviewer, force_team_add=True) |
744 | 259 | True | 292 | (True, <DBItem TeamMembershipStatus.APPROVED...) |
745 | 260 | >>> [m.displayname for m in t4.allmembers] | 293 | >>> [m.displayname for m in t4.allmembers] |
747 | 261 | [u'Foo Bar', u'Guilherme Salgado', u't1', u't2', u't3', u't5'] | 294 | [u'Guilherme Salgado', u'James Blackwell', u'Jeff Waugh', |
748 | 295 | u'No Privileges Person', u't1', u't2', u't3', u't5'] | ||
749 | 262 | 296 | ||
750 | 263 | >>> flush_database_updates() | 297 | >>> flush_database_updates() |
751 | 264 | 298 | ||
752 | @@ -305,18 +339,20 @@ | |||
753 | 305 | member anymore, it doesn't have any members apart from its owner. | 339 | member anymore, it doesn't have any members apart from its owner. |
754 | 306 | 340 | ||
755 | 307 | >>> [m.displayname for m in t5.allmembers] | 341 | >>> [m.displayname for m in t5.allmembers] |
757 | 308 | [u'Foo Bar'] | 342 | [u'No Privileges Person'] |
758 | 309 | 343 | ||
759 | 310 | Removing t2 from t5 won't remove it from t4, because t2 is also a member of | 344 | Removing t2 from t5 won't remove it from t4, because t2 is also a member of |
760 | 311 | t1, which is a member of t4. | 345 | t1, which is a member of t4. |
761 | 312 | 346 | ||
762 | 313 | >>> [m.displayname for m in t4.allmembers] | 347 | >>> [m.displayname for m in t4.allmembers] |
764 | 314 | [u'Foo Bar', u'Guilherme Salgado', u't1', u't2', u't3', u't5'] | 348 | [u'Guilherme Salgado', u'James Blackwell', u'Jeff Waugh', |
765 | 349 | u'No Privileges Person', u't1', u't2', u't3', u't5'] | ||
766 | 315 | 350 | ||
767 | 316 | Nothing changes in t1, because t5 wasn't one of its members. | 351 | Nothing changes in t1, because t5 wasn't one of its members. |
768 | 317 | 352 | ||
769 | 318 | >>> [m.displayname for m in t1.allmembers] | 353 | >>> [m.displayname for m in t1.allmembers] |
771 | 319 | [u'Foo Bar', u'Guilherme Salgado', u't2', u't3'] | 354 | [u'Guilherme Salgado', u'James Blackwell', u'Jeff Waugh', |
772 | 355 | u'No Privileges Person', u't2', u't3'] | ||
773 | 320 | 356 | ||
774 | 321 | If 'Guilherme Salgado' decides to leave t3, he'll also be removed from t1 | 357 | If 'Guilherme Salgado' decides to leave t3, he'll also be removed from t1 |
775 | 322 | and t2, but not from t4, because he's a direct member of t4. | 358 | and t2, but not from t4, because he's a direct member of t4. |
776 | @@ -350,31 +386,31 @@ | |||
777 | 350 | 386 | ||
778 | 351 | >>> cprov = getUtility(IPersonSet).getByName('cprov') | 387 | >>> cprov = getUtility(IPersonSet).getByName('cprov') |
779 | 352 | >>> t3.addMember(cprov, reviewer) | 388 | >>> t3.addMember(cprov, reviewer) |
781 | 353 | True | 389 | (True, <DBItem TeamMembershipStatus.APPROVED...) |
782 | 354 | >>> [m.displayname for m in t3.allmembers] | 390 | >>> [m.displayname for m in t3.allmembers] |
784 | 355 | [u'Celso Providelo', u'Foo Bar'] | 391 | [...u'Celso Providelo'... |
785 | 356 | 392 | ||
786 | 357 | >>> [m.displayname for m in t2.allmembers] | 393 | >>> [m.displayname for m in t2.allmembers] |
788 | 358 | [u'Celso Providelo', u'Foo Bar', u't3'] | 394 | [...u'Celso Providelo'... |
789 | 359 | 395 | ||
790 | 360 | >>> [m.displayname for m in t1.allmembers] | 396 | >>> [m.displayname for m in t1.allmembers] |
792 | 361 | [u'Celso Providelo', u'Foo Bar', u't2', u't3'] | 397 | [...u'Celso Providelo'... |
793 | 362 | 398 | ||
794 | 363 | >>> [m.displayname for m in t4.allmembers] | 399 | >>> [m.displayname for m in t4.allmembers] |
805 | 364 | [u'Celso Providelo', u'Foo Bar', u'Guilherme Salgado', u't1', u't2', | 400 | [...u'Celso Providelo'... |
806 | 365 | u't3', u't5'] | 401 | |
807 | 366 | 402 | ||
808 | 367 | 403 | It's important to note that even if the owner leaves the team, which | |
809 | 368 | It's important to note that even if Foo Bar leaves the team he's the owner, | 404 | removes his membership, he will still be the team's owner and retain his |
810 | 369 | he'll retains his rights over the team because he's the team's owner. This | 405 | rights over it. This ensures we'll never have teams which can't be |
811 | 370 | ensures we'll never have teams which can't be managed. | 406 | managed. |
812 | 371 | 407 | ||
813 | 372 | >>> login_person(foobar) | 408 | >>> login_person(t5.teamowner) |
814 | 373 | >>> foobar.leave(t5) | 409 | >>> t5.teamowner.leave(t5) |
815 | 374 | >>> flush_database_updates() | 410 | >>> flush_database_updates() |
816 | 375 | >>> [m.displayname for m in t5.allmembers] | 411 | >>> [m.displayname for m in t5.allmembers] |
817 | 376 | [] | 412 | [] |
819 | 377 | >>> foobar.inTeam(t5) | 413 | >>> t5.teamowner.inTeam(t5) |
820 | 378 | True | 414 | True |
821 | 379 | 415 | ||
822 | 380 | 416 | ||
823 | @@ -390,7 +426,7 @@ | |||
824 | 390 | 426 | ||
825 | 391 | # Foo Bar is a launchpad admin, but even so he can't change a membership's | 427 | # Foo Bar is a launchpad admin, but even so he can't change a membership's |
826 | 392 | # status/expiry-date by hand. | 428 | # status/expiry-date by hand. |
828 | 393 | >>> login('foo.bar@canonical.com') | 429 | >>> login_person(foobar) |
829 | 394 | >>> membership = foobar.myactivememberships[0] | 430 | >>> membership = foobar.myactivememberships[0] |
830 | 395 | >>> membership.status = None | 431 | >>> membership.status = None |
831 | 396 | Traceback (most recent call last): | 432 | Traceback (most recent call last): |
832 | @@ -709,7 +745,7 @@ | |||
833 | 709 | 745 | ||
834 | 710 | >>> [(membership.person.name, membership.status.title) | 746 | >>> [(membership.person.name, membership.status.title) |
835 | 711 | ... for membership in t3.member_memberships] | 747 | ... for membership in t3.member_memberships] |
837 | 712 | [(u'cprov', 'Approved'), (u'name16', 'Administrator')] | 748 | [(u'cprov', 'Approved'), (u'jdub', 'Administrator')] |
838 | 713 | 749 | ||
839 | 714 | A team has a number of other methods that return the people which are members | 750 | A team has a number of other methods that return the people which are members |
840 | 715 | of it, all based on Person.getMembersByStatus: | 751 | of it, all based on Person.getMembersByStatus: |
841 | @@ -748,7 +784,7 @@ | |||
842 | 748 | admin members plus the owner in case he is not one of the admin members. | 784 | admin members plus the owner in case he is not one of the admin members. |
843 | 749 | 785 | ||
844 | 750 | >>> [admin.unique_displayname for admin in t3.adminmembers] | 786 | >>> [admin.unique_displayname for admin in t3.adminmembers] |
846 | 751 | [u'Foo Bar (name16)'] | 787 | [u'Jeff Waugh (jdub)'] |
847 | 752 | >>> list(t3.getDirectAdministrators()) == list(t3.adminmembers) | 788 | >>> list(t3.getDirectAdministrators()) == list(t3.adminmembers) |
848 | 753 | True | 789 | True |
849 | 754 | 790 | ||
850 | @@ -823,7 +859,7 @@ | |||
851 | 823 | >>> admins = getUtility(IPersonSet).getByName('admins') | 859 | >>> admins = getUtility(IPersonSet).getByName('admins') |
852 | 824 | >>> login_person(t1.teamowner) | 860 | >>> login_person(t1.teamowner) |
853 | 825 | >>> t1.addMember(admins, reviewer=t1.teamowner, force_team_add=True) | 861 | >>> t1.addMember(admins, reviewer=t1.teamowner, force_team_add=True) |
855 | 826 | True | 862 | (True, <DBItem TeamMembershipStatus.APPROVED...) |
856 | 827 | >>> flush_database_updates() | 863 | >>> flush_database_updates() |
857 | 828 | >>> print '\n'.join(sorted( | 864 | >>> print '\n'.join(sorted( |
858 | 829 | ... team.name for team in salgado.teams_participated_in)) | 865 | ... team.name for team in salgado.teams_participated_in)) |
859 | @@ -834,11 +870,12 @@ | |||
860 | 834 | t1 | 870 | t1 |
861 | 835 | t4 | 871 | t4 |
862 | 836 | 872 | ||
864 | 837 | On the other hand, making t2 a member of admins won't change anything | 873 | On the other hand, making t3 a member of admins won't change anything |
865 | 838 | for Salgado. | 874 | for Salgado. |
866 | 839 | 875 | ||
869 | 840 | >>> admins.addMember(t2, reviewer=admins.teamowner, force_team_add=True) | 876 | >>> login_person(foobar) |
870 | 841 | True | 877 | >>> admins.addMember(t3, reviewer=admins.teamowner, force_team_add=True) |
871 | 878 | (True, <DBItem TeamMembershipStatus.APPROVED...) | ||
872 | 842 | >>> flush_database_updates() | 879 | >>> flush_database_updates() |
873 | 843 | >>> print '\n'.join(sorted( | 880 | >>> print '\n'.join(sorted( |
874 | 844 | ... team.name for team in salgado.teams_participated_in)) | 881 | ... team.name for team in salgado.teams_participated_in)) |
875 | @@ -855,8 +892,8 @@ | |||
876 | 855 | Person instances have membership caches (_inTeam_cache) to avoid the | 892 | Person instances have membership caches (_inTeam_cache) to avoid the |
877 | 856 | need to reissue identical membership queries repeatedly. (This test uses | 893 | need to reissue identical membership queries repeatedly. (This test uses |
878 | 857 | Person directly to allow us access to an unproxied object, since | 894 | Person directly to allow us access to an unproxied object, since |
881 | 858 | _inTeam_cache is private, and TeamMembershipSet directly to allow us to | 895 | _inTeam_cache is private, and it uses TeamMembershipSet directly to allow |
882 | 859 | call TeamMembership.setStatus, which is private). | 896 | us to call TeamMembership.setStatus, which is private). |
883 | 860 | 897 | ||
884 | 861 | >>> from lp.registry.model.person import Person | 898 | >>> from lp.registry.model.person import Person |
885 | 862 | >>> from lp.registry.model.teammembership import TeamMembershipSet | 899 | >>> from lp.registry.model.teammembership import TeamMembershipSet |
886 | @@ -864,7 +901,7 @@ | |||
887 | 864 | >>> no_priv.inTeam(admins) | 901 | >>> no_priv.inTeam(admins) |
888 | 865 | False | 902 | False |
889 | 866 | >>> no_priv._inTeam_cache | 903 | >>> no_priv._inTeam_cache |
891 | 867 | {25: False} | 904 | {...25: False...} |
892 | 868 | 905 | ||
893 | 869 | This cache is cleared when memberships are created: | 906 | This cache is cleared when memberships are created: |
894 | 870 | 907 | ||
895 | @@ -920,7 +957,7 @@ | |||
896 | 920 | >>> transaction.commit() | 957 | >>> transaction.commit() |
897 | 921 | 958 | ||
898 | 922 | >>> [m.displayname for m in t3.allmembers] | 959 | >>> [m.displayname for m in t3.allmembers] |
900 | 923 | [u'Bad-user', u'Foo Bar'] | 960 | [u'Bad-user', u'Jeff Waugh'] |
901 | 924 | >>> bad_user.is_valid_person | 961 | >>> bad_user.is_valid_person |
902 | 925 | False | 962 | False |
903 | 926 | >>> print bad_user.preferredemail | 963 | >>> print bad_user.preferredemail |
904 | 927 | 964 | ||
905 | === modified file 'lib/lp/registry/doc/vocabularies.txt' | |||
906 | --- lib/lp/registry/doc/vocabularies.txt 2009-12-07 16:07:43 +0000 | |||
907 | +++ lib/lp/registry/doc/vocabularies.txt 2010-01-05 17:55:34 +0000 | |||
908 | @@ -255,8 +255,7 @@ | |||
909 | 255 | 255 | ||
910 | 256 | >>> from canonical.launchpad.interfaces import PersonVisibility | 256 | >>> from canonical.launchpad.interfaces import PersonVisibility |
911 | 257 | >>> otherteam = person_set.getByName('otherteam') | 257 | >>> otherteam = person_set.getByName('otherteam') |
914 | 258 | >>> otherteam.addMember(foo_bar, foo_bar) | 258 | >>> ignored = otherteam.addMember(foo_bar, foo_bar) |
913 | 259 | |||
915 | 260 | >>> otherteam.visibility = PersonVisibility.PRIVATE_MEMBERSHIP | 259 | >>> otherteam.visibility = PersonVisibility.PRIVATE_MEMBERSHIP |
916 | 261 | >>> for term in person_active_membership: | 260 | >>> for term in person_active_membership: |
917 | 262 | ... print term.token, term.value.displayname, term.title | 261 | ... print term.token, term.value.displayname, term.title |
918 | @@ -1398,7 +1397,7 @@ | |||
919 | 1398 | >>> registry_member = factory.makePerson() | 1397 | >>> registry_member = factory.makePerson() |
920 | 1399 | >>> celebs = getUtility(ILaunchpadCelebrities) | 1398 | >>> celebs = getUtility(ILaunchpadCelebrities) |
921 | 1400 | >>> registry = celebs.registry_experts | 1399 | >>> registry = celebs.registry_experts |
923 | 1401 | >>> registry.addMember(registry_member, registry.teamowner) | 1400 | >>> ignored = registry.addMember(registry_member, registry.teamowner) |
924 | 1402 | >>> logout() | 1401 | >>> logout() |
925 | 1403 | 1402 | ||
926 | 1404 | >>> login_person(registry_member) | 1403 | >>> login_person(registry_member) |
927 | 1405 | 1404 | ||
928 | === modified file 'lib/lp/registry/stories/mailinglists/lifecycle.txt' | |||
929 | --- lib/lp/registry/stories/mailinglists/lifecycle.txt 2009-12-03 21:19:49 +0000 | |||
930 | +++ lib/lp/registry/stories/mailinglists/lifecycle.txt 2010-01-05 17:55:34 +0000 | |||
931 | @@ -363,7 +363,7 @@ | |||
932 | 363 | >>> person_set = getUtility(IPersonSet) | 363 | >>> person_set = getUtility(IPersonSet) |
933 | 364 | >>> test = person_set.getByName('name12') | 364 | >>> test = person_set.getByName('name12') |
934 | 365 | >>> experts = getUtility(ILaunchpadCelebrities).mailing_list_experts | 365 | >>> experts = getUtility(ILaunchpadCelebrities).mailing_list_experts |
936 | 366 | >>> experts.addMember(test, reviewer=experts.teamowner) | 366 | >>> ignored = experts.addMember(test, reviewer=experts.teamowner) |
937 | 367 | >>> logout() | 367 | >>> logout() |
938 | 368 | >>> transaction.commit() | 368 | >>> transaction.commit() |
939 | 369 | 369 | ||
940 | 370 | 370 | ||
941 | === modified file 'lib/lp/registry/stories/mailinglists/subscriptions.txt' | |||
942 | --- lib/lp/registry/stories/mailinglists/subscriptions.txt 2009-12-03 20:28:54 +0000 | |||
943 | +++ lib/lp/registry/stories/mailinglists/subscriptions.txt 2010-01-05 17:55:34 +0000 | |||
944 | @@ -195,7 +195,7 @@ | |||
945 | 195 | >>> person_set = getUtility(IPersonSet) | 195 | >>> person_set = getUtility(IPersonSet) |
946 | 196 | >>> jdub = person_set.getByName('jdub') | 196 | >>> jdub = person_set.getByName('jdub') |
947 | 197 | >>> mark = person_set.getByName('mark') | 197 | >>> mark = person_set.getByName('mark') |
949 | 198 | >>> beta.addMember(jdub, reviewer=mark) | 198 | >>> ignored = beta.addMember(jdub, reviewer=mark) |
950 | 199 | >>> from canonical.database.sqlbase import flush_database_updates | 199 | >>> from canonical.database.sqlbase import flush_database_updates |
951 | 200 | >>> flush_database_updates() | 200 | >>> flush_database_updates() |
952 | 201 | >>> logout() | 201 | >>> logout() |
953 | @@ -424,9 +424,9 @@ | |||
954 | 424 | >>> salgado = person_set.getByName('salgado') | 424 | >>> salgado = person_set.getByName('salgado') |
955 | 425 | >>> jordi = person_set.getByName('jordi') | 425 | >>> jordi = person_set.getByName('jordi') |
956 | 426 | >>> rosetta_admins = person_set.getByName('rosetta-admins') | 426 | >>> rosetta_admins = person_set.getByName('rosetta-admins') |
958 | 427 | >>> rosetta_admins.addMember(salgado, reviewer=mark) | 427 | >>> ignored = rosetta_admins.addMember(salgado, reviewer=mark) |
959 | 428 | >>> rosetta_admins.mailing_list.subscribe(salgado) | 428 | >>> rosetta_admins.mailing_list.subscribe(salgado) |
961 | 429 | >>> rosetta_admins.addMember(jordi, reviewer=mark) | 429 | >>> ignored = rosetta_admins.addMember(jordi, reviewer=mark) |
962 | 430 | >>> rosetta_admins.mailing_list.subscribe(jordi) | 430 | >>> rosetta_admins.mailing_list.subscribe(jordi) |
963 | 431 | >>> logout() | 431 | >>> logout() |
964 | 432 | >>> browser.reload() | 432 | >>> browser.reload() |
965 | 433 | 433 | ||
966 | === modified file 'lib/lp/registry/stories/person/xx-admin-person-review.txt' | |||
967 | --- lib/lp/registry/stories/person/xx-admin-person-review.txt 2010-01-04 10:24:29 +0000 | |||
968 | +++ lib/lp/registry/stories/person/xx-admin-person-review.txt 2010-01-05 17:55:34 +0000 | |||
969 | @@ -103,7 +103,8 @@ | |||
970 | 103 | >>> from canonical.launchpad.interfaces import ILaunchpadCelebrities | 103 | >>> from canonical.launchpad.interfaces import ILaunchpadCelebrities |
971 | 104 | >>> from zope.component import getUtility | 104 | >>> from zope.component import getUtility |
972 | 105 | >>> registry_team = getUtility(ILaunchpadCelebrities).registry_experts | 105 | >>> registry_team = getUtility(ILaunchpadCelebrities).registry_experts |
974 | 106 | >>> registry_team.addMember(registry_expert, registry_team.teamowner) | 106 | >>> ignored = registry_team.addMember( |
975 | 107 | ... registry_expert, registry_team.teamowner) | ||
976 | 107 | >>> print registry_expert.inTeam(registry_team) | 108 | >>> print registry_expert.inTeam(registry_team) |
977 | 108 | True | 109 | True |
978 | 109 | >>> logout() | 110 | >>> logout() |
979 | 110 | 111 | ||
980 | === modified file 'lib/lp/registry/stories/product/xx-product-edit.txt' | |||
981 | --- lib/lp/registry/stories/product/xx-product-edit.txt 2009-10-08 16:29:45 +0000 | |||
982 | +++ lib/lp/registry/stories/product/xx-product-edit.txt 2010-01-05 17:55:34 +0000 | |||
983 | @@ -292,7 +292,7 @@ | |||
984 | 292 | ... name='reggie', email='reggie@example.com', password='test') | 292 | ... name='reggie', email='reggie@example.com', password='test') |
985 | 293 | >>> celebs = getUtility(ILaunchpadCelebrities) | 293 | >>> celebs = getUtility(ILaunchpadCelebrities) |
986 | 294 | >>> registry = celebs.registry_experts | 294 | >>> registry = celebs.registry_experts |
988 | 295 | >>> registry.addMember(registry_member, registry.teamowner) | 295 | >>> ignored = registry.addMember(registry_member, registry.teamowner) |
989 | 296 | >>> logout() | 296 | >>> logout() |
990 | 297 | 297 | ||
991 | 298 | >>> registry_browser = setupBrowser( | 298 | >>> registry_browser = setupBrowser( |
992 | 299 | 299 | ||
993 | === modified file 'lib/lp/registry/stories/product/xx-productset.txt' | |||
994 | --- lib/lp/registry/stories/product/xx-productset.txt 2009-09-18 17:38:50 +0000 | |||
995 | +++ lib/lp/registry/stories/product/xx-productset.txt 2010-01-05 17:55:34 +0000 | |||
996 | @@ -23,7 +23,7 @@ | |||
997 | 23 | ... name='reggie', email='reggie@example.com', password='test') | 23 | ... name='reggie', email='reggie@example.com', password='test') |
998 | 24 | >>> celebs = getUtility(ILaunchpadCelebrities) | 24 | >>> celebs = getUtility(ILaunchpadCelebrities) |
999 | 25 | >>> registry = celebs.registry_experts | 25 | >>> registry = celebs.registry_experts |
1001 | 26 | >>> registry.addMember(registry_member, registry.teamowner) | 26 | >>> ignored = registry.addMember(registry_member, registry.teamowner) |
1002 | 27 | >>> logout() | 27 | >>> logout() |
1003 | 28 | 28 | ||
1004 | 29 | >>> registry_browser = setupBrowser( | 29 | >>> registry_browser = setupBrowser( |
1005 | 30 | 30 | ||
1006 | === modified file 'lib/lp/registry/stories/team/xx-team-add-my-teams.txt' | |||
1007 | --- lib/lp/registry/stories/team/xx-team-add-my-teams.txt 2009-11-22 15:43:16 +0000 | |||
1008 | +++ lib/lp/registry/stories/team/xx-team-add-my-teams.txt 2010-01-05 17:55:34 +0000 | |||
1009 | @@ -6,8 +6,9 @@ | |||
1010 | 6 | This is done from the +add-my-teams page, which is linked from a team's | 6 | This is done from the +add-my-teams page, which is linked from a team's |
1011 | 7 | home page. | 7 | home page. |
1012 | 8 | 8 | ||
1015 | 9 | >>> browser = setupBrowser(auth='Basic salgado@ubuntu.com:zeca') | 9 | >>> browser = setupBrowser( |
1016 | 10 | >>> browser.open('http://launchpad.dev/~ubuntu-team') | 10 | ... auth='Basic colin.watson@ubuntulinux.com:test') |
1017 | 11 | >>> browser.open('http://launchpad.dev/~name21') | ||
1018 | 11 | >>> browser.getLink('Add one of my teams').click() | 12 | >>> browser.getLink('Add one of my teams').click() |
1019 | 12 | >>> browser.title | 13 | >>> browser.title |
1020 | 13 | 'Propose/add one of your teams to another one... | 14 | 'Propose/add one of your teams to another one... |
1021 | @@ -18,47 +19,48 @@ | |||
1022 | 18 | >>> print extract_text(find_tag_by_id(browser.contents, 'candidates')) | 19 | >>> print extract_text(find_tag_by_id(browser.contents, 'candidates')) |
1023 | 19 | This is a moderated team, so one of its administrators will have | 20 | This is a moderated team, so one of its administrators will have |
1024 | 20 | to review any memberships you propose. | 21 | to review any memberships you propose. |
1028 | 21 | Launchpad Administrators | 22 | GuadaMen |
1029 | 22 | Mailing List Experts | 23 | Ubuntu Security Team |
1030 | 23 | Rosetta Administrators | 24 | Ubuntu Team |
1031 | 24 | or Cancel | 25 | or Cancel |
1032 | 25 | 26 | ||
1034 | 26 | We'll now propose Launchpad Administrators as a member of Ubuntu Team. | 27 | We'll now propose Ubuntu Team as a member of the Hoary Gnome Team (name21). |
1035 | 27 | 28 | ||
1037 | 28 | >>> browser.getControl(name='field.teams').value = ['admins'] | 29 | >>> browser.open('http://launchpad.dev/~name21') |
1038 | 30 | >>> link = browser.getLink('Add one of my teams') | ||
1039 | 31 | >>> link.click() | ||
1040 | 32 | >>> browser.getControl(name='field.teams').value = ['ubuntu-team'] | ||
1041 | 29 | >>> browser.getControl('Continue').click() | 33 | >>> browser.getControl('Continue').click() |
1042 | 30 | >>> browser.title | 34 | >>> browser.title |
1044 | 31 | 'Ubuntu Team in Launchpad' | 35 | 'Hoary Gnome Team in Launchpad' |
1045 | 32 | >>> print get_feedback_messages(browser.contents) | 36 | >>> print get_feedback_messages(browser.contents) |
1047 | 33 | [u'Launchpad Administrators has been proposed to this team.'] | 37 | [u'Ubuntu Team has been proposed to this team.'] |
1048 | 34 | >>> print extract_text( | 38 | >>> print extract_text( |
1050 | 35 | ... find_tag_by_id(browser.contents, 'recently-applied')) | 39 | ... find_tag_by_id(browser.contents, 'recently-proposed')) |
1051 | 36 | Pending approval | 40 | Pending approval |
1054 | 37 | Launchpad Administrators | 41 | Ubuntu Team... |
1053 | 38 | ... | ||
1055 | 39 | 42 | ||
1056 | 40 | If it were an OPEN team, we'd be able to directly add any of our teams as | 43 | If it were an OPEN team, we'd be able to directly add any of our teams as |
1057 | 41 | members. | 44 | members. |
1058 | 42 | 45 | ||
1060 | 43 | >>> admin_browser.open('http://launchpad.dev/~ubuntu-team/+edit') | 46 | >>> admin_browser.open('http://launchpad.dev/~name21/+edit') |
1061 | 44 | >>> admin_browser.getControl( | 47 | >>> admin_browser.getControl( |
1062 | 45 | ... name='field.subscriptionpolicy').displayValue = ['Open Team'] | 48 | ... name='field.subscriptionpolicy').displayValue = ['Open Team'] |
1063 | 46 | >>> admin_browser.getControl('Save').click() | 49 | >>> admin_browser.getControl('Save').click() |
1064 | 47 | >>> admin_browser.title | 50 | >>> admin_browser.title |
1066 | 48 | 'Ubuntu Team in Launchpad' | 51 | 'Hoary Gnome Team in Launchpad' |
1067 | 49 | 52 | ||
1070 | 50 | >>> browser.open('http://launchpad.dev/~ubuntu-team/+add-my-teams') | 53 | >>> browser.open('http://launchpad.dev/~name21/+add-my-teams') |
1071 | 51 | >>> browser.getControl(name='field.teams').value = ['rosetta-admins'] | 54 | >>> browser.getControl(name='field.teams').value = ['ubuntu-team'] |
1072 | 52 | >>> browser.getControl('Continue').click() | 55 | >>> browser.getControl('Continue').click() |
1073 | 53 | >>> browser.title | 56 | >>> browser.title |
1075 | 54 | 'Ubuntu Team in Launchpad' | 57 | 'Hoary Gnome Team in Launchpad' |
1076 | 55 | >>> print get_feedback_messages(browser.contents) | 58 | >>> print get_feedback_messages(browser.contents) |
1078 | 56 | [u'Rosetta Administrators has been added to this team.'] | 59 | [u'Ubuntu Team has been added to this team.'] |
1079 | 57 | >>> print extract_text( | 60 | >>> print extract_text( |
1080 | 58 | ... find_tag_by_id(browser.contents, 'recently-approved')) | 61 | ... find_tag_by_id(browser.contents, 'recently-approved')) |
1084 | 59 | Recently approved | 62 | Latest members |
1085 | 60 | Rosetta Administrators | 63 | Ubuntu Team... |
1083 | 61 | ... | ||
1086 | 62 | 64 | ||
1087 | 63 | In the case of restricted teams, though, there is no way to propose any of | 65 | In the case of restricted teams, though, there is no way to propose any of |
1088 | 64 | your teams as members. | 66 | your teams as members. |
1089 | @@ -88,38 +90,38 @@ | |||
1090 | 88 | Traceback (most recent call last): | 90 | Traceback (most recent call last): |
1091 | 89 | Unauthorized:... | 91 | Unauthorized:... |
1092 | 90 | 92 | ||
1099 | 91 | You also can't propose a team to itself. Here although Salgado is usually | 93 | You also can't propose a team to itself. Here although Colin Watson is |
1100 | 92 | allowed to propose Launchpad Administrators in other team, it doesn't | 94 | usually allowed to propose Guadamen in other team, it doesn't appear in |
1101 | 93 | appear in the list when proposing a team for the Launchpad | 95 | the list when proposing a team for the Guadamen team. Likewise Mailing |
1102 | 94 | Administrators team. Likewise Mailing List Experts isn't shown because | 96 | List Experts isn't shown because the Launchpad Administrators are a |
1103 | 95 | the Launchpad Administrators are a member of Mailing List Experts. | 97 | member of Mailing List Experts. Adding Mailing List Experts would |
1104 | 96 | Adding Mailing List Experts would create a cycle. | 98 | create a cycle. |
1105 | 97 | 99 | ||
1107 | 98 | >>> browser.open('http://launchpad.dev/~admins/+add-my-teams') | 100 | >>> browser.open('http://launchpad.dev/~guadamen/+add-my-teams') |
1108 | 99 | >>> browser.getControl(name='field.teams').options | 101 | >>> browser.getControl(name='field.teams').options |
1110 | 100 | ['rosetta-admins'] | 102 | ['ubuntu-security'] |
1111 | 101 | 103 | ||
1112 | 102 | Teams that are already member of the team can't be proposed or added. | 104 | Teams that are already member of the team can't be proposed or added. |
1115 | 103 | For example, Rosetta Administrators is not in the list of choices | 105 | For example, Ubuntu Team is not in the list of choices |
1116 | 104 | anymore of the Ubuntu Team: | 106 | anymore of the Hoary Gnome Team: |
1117 | 105 | 107 | ||
1119 | 106 | >>> admin_browser.open('http://launchpad.dev/~ubuntu-team/+edit') | 108 | >>> admin_browser.open('http://launchpad.dev/~name21/+edit') |
1120 | 107 | >>> admin_browser.getControl( | 109 | >>> admin_browser.getControl( |
1121 | 108 | ... name='field.subscriptionpolicy').displayValue = ['Open'] | 110 | ... name='field.subscriptionpolicy').displayValue = ['Open'] |
1122 | 109 | >>> admin_browser.getControl('Save').click() | 111 | >>> admin_browser.getControl('Save').click() |
1123 | 110 | 112 | ||
1125 | 111 | >>> browser.open('http://launchpad.dev/~ubuntu-team/+add-my-teams') | 113 | >>> browser.open('http://launchpad.dev/~name21/+members') |
1126 | 114 | >>> browser.open('http://launchpad.dev/~name21/+add-my-teams') | ||
1127 | 112 | >>> browser.getControl(name='field.teams').options | 115 | >>> browser.getControl(name='field.teams').options |
1129 | 113 | ['admins', 'mailing-list-experts'] | 116 | ['guadamen', 'ubuntu-security'] |
1130 | 114 | >>> browser.getControl(name='field.teams').value = [ | 117 | >>> browser.getControl(name='field.teams').value = [ |
1132 | 115 | ... 'admins', 'mailing-list-experts'] | 118 | ... 'guadamen', 'ubuntu-security'] |
1133 | 116 | >>> browser.getControl('Continue').click() | 119 | >>> browser.getControl('Continue').click() |
1134 | 117 | >>> print "\n".join(get_feedback_messages(browser.contents)) | 120 | >>> print "\n".join(get_feedback_messages(browser.contents)) |
1137 | 118 | Launchpad Administrators, Mailing List Experts have been added to this | 121 | GuadaMen, Ubuntu Security Team have been added to this team. |
1136 | 119 | team. | ||
1138 | 120 | 122 | ||
1139 | 121 | And when no teams can be added, a message is displayed: | 123 | And when no teams can be added, a message is displayed: |
1140 | 122 | 124 | ||
1142 | 123 | >>> browser.open('http://launchpad.dev/~ubuntu-team/+add-my-teams') | 125 | >>> browser.open('http://launchpad.dev/~name21/+add-my-teams') |
1143 | 124 | >>> print extract_text(find_tag_by_id(browser.contents, 'no-candidates')) | 126 | >>> print extract_text(find_tag_by_id(browser.contents, 'no-candidates')) |
1144 | 125 | None of the teams you administer can be added to this team. | 127 | None of the teams you administer can be added to this team. |
1145 | 126 | 128 | ||
1146 | === modified file 'lib/lp/registry/stories/teammembership/20-managing-members.txt' | |||
1147 | --- lib/lp/registry/stories/teammembership/20-managing-members.txt 2009-09-18 21:24:09 +0000 | |||
1148 | +++ lib/lp/registry/stories/teammembership/20-managing-members.txt 2010-01-05 17:55:34 +0000 | |||
1149 | @@ -28,7 +28,15 @@ | |||
1150 | 28 | >>> print_members(browser.contents, 'proposedmembers') | 28 | >>> print_members(browser.contents, 'proposedmembers') |
1151 | 29 | Foo Bar | 29 | Foo Bar |
1152 | 30 | 30 | ||
1154 | 31 | >>> print_members(browser.contents, 'inactivemembers') | 31 | Former members are only viewable by admins of the team. |
1155 | 32 | |||
1156 | 33 | >>> print find_tag_by_id(browser.contents, 'inactivemembers') | ||
1157 | 34 | None | ||
1158 | 35 | |||
1159 | 36 | >>> name12_browser = setupBrowser( | ||
1160 | 37 | ... auth="Basic test@canonical.com:test") | ||
1161 | 38 | >>> name12_browser.open(browser.url) | ||
1162 | 39 | >>> print_members(name12_browser.contents, 'inactivemembers') | ||
1163 | 32 | Karl Tilbury | 40 | Karl Tilbury |
1164 | 33 | No Privileges Person | 41 | No Privileges Person |
1165 | 34 | 42 | ||
1166 | @@ -57,12 +65,13 @@ | |||
1167 | 57 | ... [launchpad] | 65 | ... [launchpad] |
1168 | 58 | ... default_batch_size: 2 | 66 | ... default_batch_size: 2 |
1169 | 59 | ... """) | 67 | ... """) |
1172 | 60 | >>> browser.open('http://launchpad.dev/~admins/+members?inactive_batch=2') | 68 | >>> admin_browser.open( |
1173 | 61 | >>> print_members(browser.contents, 'inactivemembers') | 69 | ... 'http://launchpad.dev/~admins/+members?inactive_batch=2') |
1174 | 70 | >>> print_members(admin_browser.contents, 'inactivemembers') | ||
1175 | 62 | Celso Providelo | 71 | Celso Providelo |
1176 | 63 | David Allouche | 72 | David Allouche |
1179 | 64 | >>> browser.getLink('Next', index=2).click() | 73 | >>> admin_browser.getLink('Next', index=2).click() |
1180 | 65 | >>> print_members(browser.contents, 'inactivemembers') | 74 | >>> print_members(admin_browser.contents, 'inactivemembers') |
1181 | 66 | James Blackwell | 75 | James Blackwell |
1182 | 67 | >>> config_data = config.pop('default-batch-size') | 76 | >>> config_data = config.pop('default-batch-size') |
1183 | 68 | 77 | ||
1184 | 69 | 78 | ||
1185 | === modified file 'lib/lp/registry/stories/teammembership/private-team.txt' | |||
1186 | --- lib/lp/registry/stories/teammembership/private-team.txt 2009-10-26 21:12:49 +0000 | |||
1187 | +++ lib/lp/registry/stories/teammembership/private-team.txt 2010-01-05 17:55:34 +0000 | |||
1188 | @@ -17,7 +17,7 @@ | |||
1189 | 17 | >>> person_set = getUtility(IPersonSet) | 17 | >>> person_set = getUtility(IPersonSet) |
1190 | 18 | >>> cprov = person_set.getByName('cprov') | 18 | >>> cprov = person_set.getByName('cprov') |
1191 | 19 | >>> login_person(owner) | 19 | >>> login_person(owner) |
1193 | 20 | >>> priv_team.addMember(cprov, reviewer=owner) | 20 | >>> ignored = priv_team.addMember(cprov, reviewer=owner) |
1194 | 21 | >>> logout() | 21 | >>> logout() |
1195 | 22 | 22 | ||
1196 | 23 | >>> admin_browser.open('http://launchpad.dev/~private-team') | 23 | >>> admin_browser.open('http://launchpad.dev/~private-team') |
1197 | 24 | 24 | ||
1198 | === modified file 'lib/lp/registry/stories/teammembership/xx-add-member.txt' | |||
1199 | --- lib/lp/registry/stories/teammembership/xx-add-member.txt 2009-10-26 14:37:31 +0000 | |||
1200 | +++ lib/lp/registry/stories/teammembership/xx-add-member.txt 2010-01-05 17:55:34 +0000 | |||
1201 | @@ -49,7 +49,7 @@ | |||
1202 | 49 | >>> from canonical.launchpad.interfaces import TeamMembershipStatus | 49 | >>> from canonical.launchpad.interfaces import TeamMembershipStatus |
1203 | 50 | >>> from canonical.launchpad.ftests import ANONYMOUS, login, logout | 50 | >>> from canonical.launchpad.ftests import ANONYMOUS, login, logout |
1204 | 51 | >>> login(ANONYMOUS) # login() because we need a zope interaction. | 51 | >>> login(ANONYMOUS) # login() because we need a zope interaction. |
1206 | 52 | >>> cprov_landscape_membership.setStatus( | 52 | >>> ignored = cprov_landscape_membership.setStatus( |
1207 | 53 | ... TeamMembershipStatus.DEACTIVATED, landscape_team.teamowner) | 53 | ... TeamMembershipStatus.DEACTIVATED, landscape_team.teamowner) |
1208 | 54 | >>> logout() | 54 | >>> logout() |
1209 | 55 | >>> cprov_landscape_membership.syncUpdate() | 55 | >>> cprov_landscape_membership.syncUpdate() |
1210 | @@ -171,44 +171,47 @@ | |||
1211 | 171 | same. When an admin accepts or declines an invitation, the other admin can't | 171 | same. When an admin accepts or declines an invitation, the other admin can't |
1212 | 172 | take action on that invitation anymore. | 172 | take action on that invitation anymore. |
1213 | 173 | 173 | ||
1215 | 174 | First invite ubuntu-team to be member of the name21 team. | 174 | First invite name20 to be a member of ubuntu-team. |
1216 | 175 | 175 | ||
1219 | 176 | >>> browser.open('http://launchpad.dev/~name21/+addmember') | 176 | >>> browser = setupBrowser( |
1220 | 177 | >>> browser.getControl('New member:').value = 'ubuntu-team' | 177 | ... auth='Basic colin.watson@ubuntulinux.com:test') |
1221 | 178 | >>> browser.open('http://launchpad.dev/~ubuntu-team/+addmember') | ||
1222 | 179 | >>> browser.getControl('New member:').value = 'name20' | ||
1223 | 178 | >>> browser.getControl('Add Member').click() | 180 | >>> browser.getControl('Add Member').click() |
1224 | 179 | 181 | ||
1225 | 180 | >>> for tag in find_tags_by_class(browser.contents, | 182 | >>> for tag in find_tags_by_class(browser.contents, |
1226 | 181 | ... 'informational message'): | 183 | ... 'informational message'): |
1227 | 182 | ... print tag.renderContents() | 184 | ... print tag.renderContents() |
1229 | 183 | Ubuntu Team (ubuntu-team) has been invited to join this team. | 185 | Warty Security Team (name20) has been invited to join this team. |
1230 | 184 | 186 | ||
1231 | 185 | Open the invitations page with one admin browser. | 187 | Open the invitations page with one admin browser. |
1232 | 186 | 188 | ||
1234 | 187 | >>> browser.open('http://launchpad.dev/~ubuntu-team/+invitation/name21') | 189 | >>> browser = setupBrowser(auth='Basic mark@example.com:test') |
1235 | 190 | >>> browser.open('http://launchpad.dev/~name20/+invitation/ubuntu-team') | ||
1236 | 188 | 191 | ||
1237 | 189 | Open the same page with another admin browser. | 192 | Open the same page with another admin browser. |
1238 | 190 | 193 | ||
1240 | 191 | >>> second_browser = setupBrowser(auth='Basic foo.bar@canonical.com:test') | 194 | >>> second_browser = setupBrowser(auth='Basic mark@example.com:test') |
1241 | 192 | >>> second_browser.open( | 195 | >>> second_browser.open( |
1243 | 193 | ... 'http://launchpad.dev/~ubuntu-team/+invitation/name21') | 196 | ... 'http://launchpad.dev/~name20/+invitation/ubuntu-team') |
1244 | 194 | 197 | ||
1245 | 195 | Accept the invitation in the first browser. | 198 | Accept the invitation in the first browser. |
1246 | 196 | 199 | ||
1247 | 197 | >>> browser.getControl('Accept').click() | 200 | >>> browser.getControl('Accept').click() |
1248 | 198 | >>> browser.url | 201 | >>> browser.url |
1250 | 199 | 'http://launchpad.dev/~ubuntu-team' | 202 | 'http://launchpad.dev/~name20' |
1251 | 200 | 203 | ||
1252 | 201 | >>> for tag in find_tags_by_class(browser.contents, | 204 | >>> for tag in find_tags_by_class(browser.contents, |
1253 | 202 | ... 'informational message'): | 205 | ... 'informational message'): |
1254 | 203 | ... print tag.renderContents() | 206 | ... print tag.renderContents() |
1256 | 204 | This team is now a member of Hoary Gnome Team | 207 | This team is now a member of Ubuntu Team |
1257 | 205 | 208 | ||
1258 | 206 | Accepting the invitation in the second browser, redirects to the team page | 209 | Accepting the invitation in the second browser, redirects to the team page |
1259 | 207 | and a message is displayed. | 210 | and a message is displayed. |
1260 | 208 | 211 | ||
1261 | 209 | >>> second_browser.getControl('Accept').click() | 212 | >>> second_browser.getControl('Accept').click() |
1262 | 210 | >>> second_browser.url | 213 | >>> second_browser.url |
1264 | 211 | 'http://launchpad.dev/~ubuntu-team' | 214 | 'http://launchpad.dev/~name20' |
1265 | 212 | 215 | ||
1266 | 213 | >>> for tag in find_tags_by_class(second_browser.contents, | 216 | >>> for tag in find_tags_by_class(second_browser.contents, |
1267 | 214 | ... 'informational message'): | 217 | ... 'informational message'): |
1268 | @@ -233,7 +236,7 @@ | |||
1269 | 233 | >>> login(ANONYMOUS) # login() because we need a zope interaction. | 236 | >>> login(ANONYMOUS) # login() because we need a zope interaction. |
1270 | 234 | >>> carlos_translators_membership = TeamMembership.selectOneBy( | 237 | >>> carlos_translators_membership = TeamMembership.selectOneBy( |
1271 | 235 | ... personID=carlos.id, teamID=ubuntu_translators.id) | 238 | ... personID=carlos.id, teamID=ubuntu_translators.id) |
1273 | 236 | >>> carlos_translators_membership.setStatus( | 239 | >>> ignored = carlos_translators_membership.setStatus( |
1274 | 237 | ... TeamMembershipStatus.DEACTIVATED, ubuntu_translators.teamowner) | 240 | ... TeamMembershipStatus.DEACTIVATED, ubuntu_translators.teamowner) |
1275 | 238 | >>> logout() | 241 | >>> logout() |
1276 | 239 | >>> carlos_translators_membership.syncUpdate() | 242 | >>> carlos_translators_membership.syncUpdate() |
1277 | 240 | 243 | ||
1278 | === modified file 'lib/lp/registry/stories/teammembership/xx-expire-subscription.txt' | |||
1279 | --- lib/lp/registry/stories/teammembership/xx-expire-subscription.txt 2009-08-13 19:03:36 +0000 | |||
1280 | +++ lib/lp/registry/stories/teammembership/xx-expire-subscription.txt 2010-01-05 17:55:34 +0000 | |||
1281 | @@ -32,7 +32,7 @@ | |||
1282 | 32 | ... personID=sampleperson.id, teamID=team.id) | 32 | ... personID=sampleperson.id, teamID=team.id) |
1283 | 33 | >>> from canonical.launchpad.ftests import ANONYMOUS, login, logout | 33 | >>> from canonical.launchpad.ftests import ANONYMOUS, login, logout |
1284 | 34 | >>> login(ANONYMOUS) # login() because we need a zope interaction. | 34 | >>> login(ANONYMOUS) # login() because we need a zope interaction. |
1286 | 35 | >>> tm.setStatus(TeamMembershipStatus.EXPIRED, team.teamowner) | 35 | >>> ignored = tm.setStatus(TeamMembershipStatus.EXPIRED, team.teamowner) |
1287 | 36 | >>> logout() | 36 | >>> logout() |
1288 | 37 | 37 | ||
1289 | 38 | Persist the change: | 38 | Persist the change: |
1290 | 39 | 39 | ||
1291 | === modified file 'lib/lp/registry/stories/teammembership/xx-member-renewed-membership.txt' | |||
1292 | --- lib/lp/registry/stories/teammembership/xx-member-renewed-membership.txt 2009-12-10 16:15:21 +0000 | |||
1293 | +++ lib/lp/registry/stories/teammembership/xx-member-renewed-membership.txt 2010-01-05 17:55:34 +0000 | |||
1294 | @@ -141,7 +141,7 @@ | |||
1295 | 141 | >>> login('mark@example.com') | 141 | >>> login('mark@example.com') |
1296 | 142 | >>> mirror_admins = personset.getByName('ubuntu-mirror-admins') | 142 | >>> mirror_admins = personset.getByName('ubuntu-mirror-admins') |
1297 | 143 | >>> landscape_devs = personset.getByName('landscape-developers') | 143 | >>> landscape_devs = personset.getByName('landscape-developers') |
1299 | 144 | >>> mirror_admins.addMember( | 144 | >>> ignored = mirror_admins.addMember( |
1300 | 145 | ... landscape_devs, mirror_admins.teamowner, force_team_add=True) | 145 | ... landscape_devs, mirror_admins.teamowner, force_team_add=True) |
1301 | 146 | >>> membership = getUtility(ITeamMembershipSet).getByPersonAndTeam( | 146 | >>> membership = getUtility(ITeamMembershipSet).getByPersonAndTeam( |
1302 | 147 | ... landscape_devs, mirror_admins) | 147 | ... landscape_devs, mirror_admins) |
1303 | 148 | 148 | ||
1304 | === modified file 'lib/lp/registry/stories/teammembership/xx-private-membership.txt' | |||
1305 | --- lib/lp/registry/stories/teammembership/xx-private-membership.txt 2009-12-01 22:09:05 +0000 | |||
1306 | +++ lib/lp/registry/stories/teammembership/xx-private-membership.txt 2010-01-05 17:55:34 +0000 | |||
1307 | @@ -43,7 +43,7 @@ | |||
1308 | 43 | <...<a href=".../~member" class="sprite person">Gold Member</a>... | 43 | <...<a href=".../~member" class="sprite person">Gold Member</a>... |
1309 | 44 | 44 | ||
1310 | 45 | 45 | ||
1312 | 46 | >>> find_tag_by_id(browser.contents, 'recently-applied') | 46 | >>> find_tag_by_id(browser.contents, 'recently-proposed') |
1313 | 47 | <...<a href=".../~no-priv" class="sprite person">No Privileges Person</a>... | 47 | <...<a href=".../~no-priv" class="sprite person">No Privileges Person</a>... |
1314 | 48 | 48 | ||
1315 | 49 | >>> print extract_text( | 49 | >>> print extract_text( |
1316 | @@ -257,9 +257,9 @@ | |||
1317 | 257 | team's home page, they see the private team show up in the "Subteam of" | 257 | team's home page, they see the private team show up in the "Subteam of" |
1318 | 258 | section. | 258 | section. |
1319 | 259 | 259 | ||
1323 | 260 | >>> admin_browser.open('http://launchpad.dev/~myteam/+addmember') | 260 | >>> owner_browser.open('http://launchpad.dev/~myteam/+addmember') |
1324 | 261 | >>> admin_browser.getControl('New member').value = 'guadamen' | 261 | >>> owner_browser.getControl('New member').value = 'guadamen' |
1325 | 262 | >>> admin_browser.getControl('Add Member').click() | 262 | >>> owner_browser.getControl('Add Member').click() |
1326 | 263 | >>> admin_browser.open( | 263 | >>> admin_browser.open( |
1327 | 264 | ... 'http://launchpad.dev/~guadamen/+invitation/myteam') | 264 | ... 'http://launchpad.dev/~guadamen/+invitation/myteam') |
1328 | 265 | >>> admin_browser.getControl('Accept').click() | 265 | >>> admin_browser.getControl('Accept').click() |
1329 | 266 | 266 | ||
1330 | === modified file 'lib/lp/registry/stories/vouchers/xx-voucher-redemption.txt' | |||
1331 | --- lib/lp/registry/stories/vouchers/xx-voucher-redemption.txt 2009-09-08 15:58:38 +0000 | |||
1332 | +++ lib/lp/registry/stories/vouchers/xx-voucher-redemption.txt 2010-01-05 17:55:34 +0000 | |||
1333 | @@ -117,7 +117,8 @@ | |||
1334 | 117 | >>> commercial_member = getUtility(IPersonSet).getByEmail( | 117 | >>> commercial_member = getUtility(IPersonSet).getByEmail( |
1335 | 118 | ... 'commercial-member@canonical.com') | 118 | ... 'commercial-member@canonical.com') |
1336 | 119 | >>> celebs = getUtility(ILaunchpadCelebrities) | 119 | >>> celebs = getUtility(ILaunchpadCelebrities) |
1338 | 120 | >>> celebs.registry_experts.addMember(commercial_member, commercial_member) | 120 | >>> ignored = celebs.registry_experts.addMember( |
1339 | 121 | ... commercial_member, commercial_member) | ||
1340 | 121 | >>> logout() | 122 | >>> logout() |
1341 | 122 | 123 | ||
1342 | 123 | >>> browser.open( | 124 | >>> browser.open( |
1343 | 124 | 125 | ||
1344 | === modified file 'lib/lp/registry/stories/webservice/xx-private-membership.txt' | |||
1345 | --- lib/lp/registry/stories/webservice/xx-private-membership.txt 2009-10-01 12:30:32 +0000 | |||
1346 | +++ lib/lp/registry/stories/webservice/xx-private-membership.txt 2010-01-05 17:55:34 +0000 | |||
1347 | @@ -35,9 +35,10 @@ | |||
1348 | 35 | Similarly, when a public team is a sub-team of a private team, non-members | 35 | Similarly, when a public team is a sub-team of a private team, non-members |
1349 | 36 | cannot see the private team in the public team's super_team's attribute. | 36 | cannot see the private team in the public team's super_team's attribute. |
1350 | 37 | 37 | ||
1354 | 38 | >>> admin_browser.open('http://launchpad.dev/~myteam/+addmember') | 38 | >>> owner_browser = setupBrowser(auth="Basic owner@canonical.com:test") |
1355 | 39 | >>> admin_browser.getControl('New member').value = 'guadamen' | 39 | >>> owner_browser.open('http://launchpad.dev/~myteam/+addmember') |
1356 | 40 | >>> admin_browser.getControl('Add Member').click() | 40 | >>> owner_browser.getControl('New member').value = 'guadamen' |
1357 | 41 | >>> owner_browser.getControl('Add Member').click() | ||
1358 | 41 | >>> admin_browser.open( | 42 | >>> admin_browser.open( |
1359 | 42 | ... 'http://launchpad.dev/~guadamen/+invitation/myteam') | 43 | ... 'http://launchpad.dev/~guadamen/+invitation/myteam') |
1360 | 43 | >>> admin_browser.getControl('Accept').click() | 44 | >>> admin_browser.getControl('Accept').click() |
1361 | 44 | 45 | ||
1362 | === modified file 'lib/lp/registry/stories/webservice/xx-source-package.txt' | |||
1363 | --- lib/lp/registry/stories/webservice/xx-source-package.txt 2009-12-05 18:37:28 +0000 | |||
1364 | +++ lib/lp/registry/stories/webservice/xx-source-package.txt 2010-01-05 17:55:34 +0000 | |||
1365 | @@ -67,7 +67,7 @@ | |||
1366 | 67 | >>> login('admin@canonical.com') | 67 | >>> login('admin@canonical.com') |
1367 | 68 | >>> person = factory.makePerson() | 68 | >>> person = factory.makePerson() |
1368 | 69 | >>> ubuntu_branches = getUtility(ILaunchpadCelebrities).ubuntu_branches | 69 | >>> ubuntu_branches = getUtility(ILaunchpadCelebrities).ubuntu_branches |
1370 | 70 | >>> ubuntu_branches.addMember(person, ubuntu_branches.teamowner) | 70 | >>> ignored = ubuntu_branches.addMember(person, ubuntu_branches.teamowner) |
1371 | 71 | >>> logout() | 71 | >>> logout() |
1372 | 72 | 72 | ||
1373 | 73 | Then we set the branch on the evolution hoary package: | 73 | Then we set the branch on the evolution hoary package: |
1374 | 74 | 74 | ||
1375 | === modified file 'lib/lp/registry/stories/webservice/xx-structuralsubscription.txt' | |||
1376 | --- lib/lp/registry/stories/webservice/xx-structuralsubscription.txt 2009-12-05 18:37:28 +0000 | |||
1377 | +++ lib/lp/registry/stories/webservice/xx-structuralsubscription.txt 2010-01-05 17:55:34 +0000 | |||
1378 | @@ -8,7 +8,7 @@ | |||
1379 | 8 | >>> eric_db = factory.makePerson(name='eric') | 8 | >>> eric_db = factory.makePerson(name='eric') |
1380 | 9 | >>> michael_db = factory.makePerson(name='michael') | 9 | >>> michael_db = factory.makePerson(name='michael') |
1381 | 10 | >>> pythons_db = factory.makeTeam(name='pythons', owner=michael_db) | 10 | >>> pythons_db = factory.makeTeam(name='pythons', owner=michael_db) |
1383 | 11 | >>> pythons_db.addMember(eric_db, michael_db) | 11 | >>> ignored = pythons_db.addMember(eric_db, michael_db) |
1384 | 12 | 12 | ||
1385 | 13 | >>> fooix_db = factory.makeProduct(name='fooix', owner=eric_db) | 13 | >>> fooix_db = factory.makeProduct(name='fooix', owner=eric_db) |
1386 | 14 | >>> fooix01_db = fooix_db.newSeries(eric_db, '0.1', 'Series 0.1') | 14 | >>> fooix01_db = fooix_db.newSeries(eric_db, '0.1', 'Series 0.1') |
1387 | 15 | 15 | ||
1388 | === modified file 'lib/lp/registry/tests/bug-249185.txt' | |||
1389 | --- lib/lp/registry/tests/bug-249185.txt 2009-04-17 10:32:16 +0000 | |||
1390 | +++ lib/lp/registry/tests/bug-249185.txt 2010-01-05 17:55:34 +0000 | |||
1391 | @@ -9,18 +9,19 @@ | |||
1392 | 9 | 9 | ||
1393 | 10 | >>> login_person(person) | 10 | >>> login_person(person) |
1394 | 11 | >>> dev1 = factory.makePerson() | 11 | >>> dev1 = factory.makePerson() |
1396 | 12 | >>> devs.addMember(dev1, person) | 12 | >>> ignored = devs.addMember(dev1, person) |
1397 | 13 | 13 | ||
1398 | 14 | Beta testers has lp-devs and adjutants as members. | 14 | Beta testers has lp-devs and adjutants as members. |
1399 | 15 | 15 | ||
1402 | 16 | >>> beta_testers.addMember(devs, person, force_team_add=True) | 16 | >>> ignored = beta_testers.addMember(devs, person, force_team_add=True) |
1403 | 17 | >>> beta_testers.addMember(adjutants, person, force_team_add=True) | 17 | >>> ignored = beta_testers.addMember( |
1404 | 18 | ... adjutants, person, force_team_add=True) | ||
1405 | 18 | >>> dev1.hasParticipationEntryFor(beta_testers) | 19 | >>> dev1.hasParticipationEntryFor(beta_testers) |
1406 | 19 | True | 20 | True |
1407 | 20 | 21 | ||
1408 | 21 | Adjutants has lp-devs as member. | 22 | Adjutants has lp-devs as member. |
1409 | 22 | 23 | ||
1411 | 23 | >>> adjutants.addMember(devs, person, force_team_add=True) | 24 | >>> ignored = adjutants.addMember(devs, person, force_team_add=True) |
1412 | 24 | >>> dev1.hasParticipationEntryFor(adjutants) | 25 | >>> dev1.hasParticipationEntryFor(adjutants) |
1413 | 25 | True | 26 | True |
1414 | 26 | 27 | ||
1415 | 27 | 28 | ||
1416 | === modified file 'lib/lp/registry/tests/test_teammembership.py' | |||
1417 | --- lib/lp/registry/tests/test_teammembership.py 2009-10-19 16:14:18 +0000 | |||
1418 | +++ lib/lp/registry/tests/test_teammembership.py 2010-01-05 17:55:34 +0000 | |||
1419 | @@ -546,8 +546,8 @@ | |||
1420 | 546 | # Invite team2 as member of team1 and team1 as member of team2. This | 546 | # Invite team2 as member of team1 and team1 as member of team2. This |
1421 | 547 | # is not a problem because that won't make any team an active member | 547 | # is not a problem because that won't make any team an active member |
1422 | 548 | # of the other. | 548 | # of the other. |
1425 | 549 | self.team1.addMember(self.team2, self.foobar) | 549 | self.team1.addMember(self.team2, self.no_priv) |
1426 | 550 | self.team2.addMember(self.team1, self.foobar) | 550 | self.team2.addMember(self.team1, self.no_priv) |
1427 | 551 | team1_on_team2 = getUtility(ITeamMembershipSet).getByPersonAndTeam( | 551 | team1_on_team2 = getUtility(ITeamMembershipSet).getByPersonAndTeam( |
1428 | 552 | self.team1, self.team2) | 552 | self.team1, self.team2) |
1429 | 553 | team2_on_team1 = getUtility(ITeamMembershipSet).getByPersonAndTeam( | 553 | team2_on_team1 = getUtility(ITeamMembershipSet).getByPersonAndTeam( |
1430 | @@ -580,7 +580,7 @@ | |||
1431 | 580 | """No status change can create cyclical participation.""" | 580 | """No status change can create cyclical participation.""" |
1432 | 581 | # Invite team1 as a member of team3 and forcibly add team2 as member | 581 | # Invite team1 as a member of team3 and forcibly add team2 as member |
1433 | 582 | # of team1 and team3 as member of team2. | 582 | # of team1 and team3 as member of team2. |
1435 | 583 | self.team3.addMember(self.team1, self.foobar) | 583 | self.team3.addMember(self.team1, self.no_priv) |
1436 | 584 | self.team1.addMember(self.team2, self.foobar, force_team_add=True) | 584 | self.team1.addMember(self.team2, self.foobar, force_team_add=True) |
1437 | 585 | self.team2.addMember(self.team3, self.foobar, force_team_add=True) | 585 | self.team2.addMember(self.team3, self.foobar, force_team_add=True) |
1438 | 586 | 586 | ||
1439 | @@ -593,7 +593,7 @@ | |||
1440 | 593 | TeamMembershipStatus.APPROVED, self.foobar) | 593 | TeamMembershipStatus.APPROVED, self.foobar) |
1441 | 594 | 594 | ||
1442 | 595 | def test_invited_member_can_be_made_admin(self): | 595 | def test_invited_member_can_be_made_admin(self): |
1444 | 596 | self.team2.addMember(self.team1, self.foobar) | 596 | self.team2.addMember(self.team1, self.no_priv) |
1445 | 597 | team1_on_team2 = getUtility(ITeamMembershipSet).getByPersonAndTeam( | 597 | team1_on_team2 = getUtility(ITeamMembershipSet).getByPersonAndTeam( |
1446 | 598 | self.team1, self.team2) | 598 | self.team1, self.team2) |
1447 | 599 | self.assertEqual(team1_on_team2.status, TeamMembershipStatus.INVITED) | 599 | self.assertEqual(team1_on_team2.status, TeamMembershipStatus.INVITED) |
1448 | 600 | 600 | ||
1449 | === modified file 'lib/lp/soyuz/browser/tests/archive-views.txt' | |||
1450 | --- lib/lp/soyuz/browser/tests/archive-views.txt 2009-11-09 17:59:18 +0000 | |||
1451 | +++ lib/lp/soyuz/browser/tests/archive-views.txt 2010-01-05 17:55:34 +0000 | |||
1452 | @@ -957,7 +957,7 @@ | |||
1453 | 957 | buildd_secret would leak through the public buildlogs. | 957 | buildd_secret would leak through the public buildlogs. |
1454 | 958 | 958 | ||
1455 | 959 | >>> login('foo.bar@canonical.com') | 959 | >>> login('foo.bar@canonical.com') |
1457 | 960 | >>> a_team.addMember(cprov, mark) | 960 | >>> ignored = a_team.addMember(cprov, mark) |
1458 | 961 | >>> login('celso.providelo@canonical.com') | 961 | >>> login('celso.providelo@canonical.com') |
1459 | 962 | 962 | ||
1460 | 963 | >>> view = create_initialized_view( | 963 | >>> view = create_initialized_view( |
1461 | @@ -1186,7 +1186,7 @@ | |||
1462 | 1186 | continue to be denied in the UI. | 1186 | continue to be denied in the UI. |
1463 | 1187 | 1187 | ||
1464 | 1188 | >>> login('foo.bar@canonical.com') | 1188 | >>> login('foo.bar@canonical.com') |
1466 | 1189 | >>> ubuntu.main_archive.owner.addMember(cprov, cprov) | 1189 | >>> ignored = ubuntu.main_archive.owner.addMember(cprov, cprov) |
1467 | 1190 | >>> login('celso.providelo@canonical.com') | 1190 | >>> login('celso.providelo@canonical.com') |
1468 | 1191 | 1191 | ||
1469 | 1192 | >>> view = create_initialized_view( | 1192 | >>> view = create_initialized_view( |
1470 | 1193 | 1193 | ||
1471 | === modified file 'lib/lp/soyuz/browser/tests/build-views.txt' | |||
1472 | --- lib/lp/soyuz/browser/tests/build-views.txt 2009-12-11 12:59:08 +0000 | |||
1473 | +++ lib/lp/soyuz/browser/tests/build-views.txt 2010-01-05 17:55:34 +0000 | |||
1474 | @@ -153,7 +153,7 @@ | |||
1475 | 153 | ... "launchpad-buildd-admins") | 153 | ... "launchpad-buildd-admins") |
1476 | 154 | >>> nopriv = getUtility(IPersonSet).getByName("no-priv") | 154 | >>> nopriv = getUtility(IPersonSet).getByName("no-priv") |
1477 | 155 | >>> login("foo.bar@canonical.com") | 155 | >>> login("foo.bar@canonical.com") |
1479 | 156 | >>> buildd_admins.addMember(nopriv, nopriv) | 156 | >>> ignored = buildd_admins.addMember(nopriv, nopriv) |
1480 | 157 | 157 | ||
1481 | 158 | >>> login("no-priv@canonical.com") | 158 | >>> login("no-priv@canonical.com") |
1482 | 159 | >>> failed_build_view = getMultiAdapter( | 159 | >>> failed_build_view = getMultiAdapter( |
1483 | 160 | 160 | ||
1484 | === modified file 'lib/lp/soyuz/doc/archive.txt' | |||
1485 | --- lib/lp/soyuz/doc/archive.txt 2009-12-25 07:54:31 +0000 | |||
1486 | +++ lib/lp/soyuz/doc/archive.txt 2010-01-05 17:55:34 +0000 | |||
1487 | @@ -1653,7 +1653,8 @@ | |||
1488 | 1653 | 1653 | ||
1489 | 1654 | But if we make him part of the uploader_team he'll gain access: | 1654 | But if we make him part of the uploader_team he'll gain access: |
1490 | 1655 | 1655 | ||
1492 | 1656 | >>> uploader_team.addMember(indirect_uploader, indirect_uploader) | 1656 | >>> ignored = uploader_team.addMember( |
1493 | 1657 | ... indirect_uploader, indirect_uploader) | ||
1494 | 1657 | >>> for ppa in archive_set.getPPAsForUser(indirect_uploader): | 1658 | >>> for ppa in archive_set.getPPAsForUser(indirect_uploader): |
1495 | 1658 | ... print ppa.displayname | 1659 | ... print ppa.displayname |
1496 | 1659 | PPA for Celso Providelo | 1660 | PPA for Celso Providelo |
1497 | @@ -2249,7 +2250,7 @@ | |||
1498 | 2249 | >>> login('foo.bar@canonical.com') | 2250 | >>> login('foo.bar@canonical.com') |
1499 | 2250 | >>> ubuntu_security = getUtility(IPersonSet).getByName( | 2251 | >>> ubuntu_security = getUtility(IPersonSet).getByName( |
1500 | 2251 | ... 'ubuntu-security') | 2252 | ... 'ubuntu-security') |
1502 | 2252 | >>> ubuntu_security.addMember(carlos, cprov) | 2253 | >>> ignored = ubuntu_security.addMember(carlos, cprov) |
1503 | 2253 | 2254 | ||
1504 | 2254 | >>> login('carlos@canonical.com') | 2255 | >>> login('carlos@canonical.com') |
1505 | 2255 | >>> check_permission('launchpad.Append', primary) | 2256 | >>> check_permission('launchpad.Append', primary) |
1506 | 2256 | 2257 | ||
1507 | === modified file 'lib/lp/soyuz/doc/archivepermission.txt' | |||
1508 | --- lib/lp/soyuz/doc/archivepermission.txt 2009-09-18 09:29:49 +0000 | |||
1509 | +++ lib/lp/soyuz/doc/archivepermission.txt 2010-01-05 17:55:34 +0000 | |||
1510 | @@ -297,7 +297,7 @@ | |||
1511 | 297 | Now add "test@canonical.com" to the techboard team and log in as him. | 297 | Now add "test@canonical.com" to the techboard team and log in as him. |
1512 | 298 | 298 | ||
1513 | 299 | >>> person = personset.getByEmail("test@canonical.com") | 299 | >>> person = personset.getByEmail("test@canonical.com") |
1515 | 300 | >>> techboard.addMember( | 300 | >>> ignored = techboard.addMember( |
1516 | 301 | ... person, reviewer=person, status=TeamMembershipStatus.APPROVED, | 301 | ... person, reviewer=person, status=TeamMembershipStatus.APPROVED, |
1517 | 302 | ... force_team_add=True) | 302 | ... force_team_add=True) |
1518 | 303 | >>> login_person(person) | 303 | >>> login_person(person) |
1519 | 304 | 304 | ||
1520 | === modified file 'lib/lp/soyuz/doc/archivesubscriber.txt' | |||
1521 | --- lib/lp/soyuz/doc/archivesubscriber.txt 2009-08-13 19:03:36 +0000 | |||
1522 | +++ lib/lp/soyuz/doc/archivesubscriber.txt 2010-01-05 17:55:34 +0000 | |||
1523 | @@ -448,7 +448,8 @@ | |||
1524 | 448 | indirect members that are not themselves groups are included: | 448 | indirect members that are not themselves groups are included: |
1525 | 449 | 449 | ||
1526 | 450 | >>> launchpad_devs = getUtility(IPersonSet).getByName('launchpad') | 450 | >>> launchpad_devs = getUtility(IPersonSet).getByName('launchpad') |
1528 | 451 | >>> launchpad_devs.addMember(team_cprov, mark, force_team_add=True) | 451 | >>> ignored = launchpad_devs.addMember( |
1529 | 452 | ... team_cprov, mark, force_team_add=True) | ||
1530 | 452 | >>> subscription = mark.archive.newSubscription( | 453 | >>> subscription = mark.archive.newSubscription( |
1531 | 453 | ... launchpad_devs, mark, description=u"LP team too") | 454 | ... launchpad_devs, mark, description=u"LP team too") |
1532 | 454 | >>> for person in subscription.getNonActiveSubscribers(): | 455 | >>> for person in subscription.getNonActiveSubscribers(): |
1533 | 455 | 456 | ||
1534 | === modified file 'lib/lp/soyuz/doc/build-notification.txt' | |||
1535 | --- lib/lp/soyuz/doc/build-notification.txt 2009-08-13 19:03:36 +0000 | |||
1536 | +++ lib/lp/soyuz/doc/build-notification.txt 2010-01-05 17:55:34 +0000 | |||
1537 | @@ -530,7 +530,7 @@ | |||
1538 | 530 | >>> LaunchpadZopelessLayer.switchDbUser('launchpad') | 530 | >>> LaunchpadZopelessLayer.switchDbUser('launchpad') |
1539 | 531 | >>> team = factory.makeTeam(owner=cprov, email="team@example.com") | 531 | >>> team = factory.makeTeam(owner=cprov, email="team@example.com") |
1540 | 532 | >>> mark = failed_candidate.sourcepackagerelease.creator | 532 | >>> mark = failed_candidate.sourcepackagerelease.creator |
1542 | 533 | >>> team.addMember(mark, mark) | 533 | >>> ignored = team.addMember(mark, mark) |
1543 | 534 | >>> discard = pop_notifications() # Discard team join email. | 534 | >>> discard = pop_notifications() # Discard team join email. |
1544 | 535 | >>> team_ppa = factory.makeArchive(owner=team) | 535 | >>> team_ppa = factory.makeArchive(owner=team) |
1545 | 536 | >>> naked_candidate = removeSecurityProxy(failed_candidate) | 536 | >>> naked_candidate = removeSecurityProxy(failed_candidate) |
1546 | 537 | 537 | ||
1547 | === modified file 'lib/lp/soyuz/doc/build.txt' | |||
1548 | --- lib/lp/soyuz/doc/build.txt 2009-11-24 07:02:21 +0000 | |||
1549 | +++ lib/lp/soyuz/doc/build.txt 2010-01-05 17:55:34 +0000 | |||
1550 | @@ -837,7 +837,7 @@ | |||
1551 | 837 | >>> buildd_admin = factory.makePerson() | 837 | >>> buildd_admin = factory.makePerson() |
1552 | 838 | >>> buildd_admins = getUtility( | 838 | >>> buildd_admins = getUtility( |
1553 | 839 | ... IPersonSet).getByName('launchpad-buildd-admins') | 839 | ... IPersonSet).getByName('launchpad-buildd-admins') |
1555 | 840 | >>> buildd_admins.addMember(buildd_admin, buildd_admin) | 840 | >>> ignored = buildd_admins.addMember(buildd_admin, buildd_admin) |
1556 | 841 | >>> bob_builds = bob.getBuildRecords(user=buildd_admin) | 841 | >>> bob_builds = bob.getBuildRecords(user=buildd_admin) |
1557 | 842 | >>> print_build_details(bob_builds) | 842 | >>> print_build_details(bob_builds) |
1558 | 843 | ubuntu-team: hppa build of mozilla-firefox 0.9 in ubuntu warty RELEASE | 843 | ubuntu-team: hppa build of mozilla-firefox 0.9 in ubuntu warty RELEASE |
1559 | @@ -845,9 +845,9 @@ | |||
1560 | 845 | ubuntu-team: i386 build of cdrkit 1.0 in ubuntu breezy-autotest RELEASE | 845 | ubuntu-team: i386 build of cdrkit 1.0 in ubuntu breezy-autotest RELEASE |
1561 | 846 | ... | 846 | ... |
1562 | 847 | ubuntu-team: i386 build of mozilla-firefox 0.9 in ubuntu warty RELEASE | 847 | ubuntu-team: i386 build of mozilla-firefox 0.9 in ubuntu warty RELEASE |
1564 | 848 | ubuntu-team: i386 build of mozilla-firefox 0.9 in ubuntu breezy-autotest | 848 | ubuntu-team: i386 build of mozilla-firefox 0.9 in ubuntu breezy-autotest |
1565 | 849 | RELEASE | 849 | RELEASE |
1567 | 850 | 850 | ||
1568 | 851 | >>> bob_builds.count() | 851 | >>> bob_builds.count() |
1569 | 852 | 13 | 852 | 13 |
1570 | 853 | 853 | ||
1571 | 854 | 854 | ||
1572 | === modified file 'lib/lp/soyuz/doc/distroseriesqueue-dist-upgrader.txt' | |||
1573 | --- lib/lp/soyuz/doc/distroseriesqueue-dist-upgrader.txt 2009-08-31 02:52:41 +0000 | |||
1574 | +++ lib/lp/soyuz/doc/distroseriesqueue-dist-upgrader.txt 2010-01-05 17:55:34 +0000 | |||
1575 | @@ -279,7 +279,7 @@ | |||
1576 | 279 | >>> beta_testers = getUtility(ILaunchpadCelebrities).launchpad_beta_testers | 279 | >>> beta_testers = getUtility(ILaunchpadCelebrities).launchpad_beta_testers |
1577 | 280 | >>> admin = getUtility(ILaunchpadCelebrities).admin | 280 | >>> admin = getUtility(ILaunchpadCelebrities).admin |
1578 | 281 | >>> name16 = getUtility(IPersonSet).getByName("name16") | 281 | >>> name16 = getUtility(IPersonSet).getByName("name16") |
1580 | 282 | >>> beta_testers.addMember(name16, admin) | 282 | >>> ignored = beta_testers.addMember(name16, admin) |
1581 | 283 | 283 | ||
1582 | 284 | >>> foobar_archive = getUtility(IArchiveSet).new( | 284 | >>> foobar_archive = getUtility(IArchiveSet).new( |
1583 | 285 | ... distribution=ubuntutest, purpose=ArchivePurpose.PPA, | 285 | ... distribution=ubuntutest, purpose=ArchivePurpose.PPA, |
1584 | 286 | 286 | ||
1585 | === modified file 'lib/lp/soyuz/doc/packageset.txt' | |||
1586 | --- lib/lp/soyuz/doc/packageset.txt 2009-08-13 15:12:16 +0000 | |||
1587 | +++ lib/lp/soyuz/doc/packageset.txt 2010-01-05 17:55:34 +0000 | |||
1588 | @@ -581,7 +581,7 @@ | |||
1589 | 581 | 581 | ||
1590 | 582 | Now add "test@canonical.com" to the techboard team and log in as him. | 582 | Now add "test@canonical.com" to the techboard team and log in as him. |
1591 | 583 | 583 | ||
1593 | 584 | >>> techboard.addMember( | 584 | >>> ignored = techboard.addMember( |
1594 | 585 | ... person2, reviewer=person2, status=TeamMembershipStatus.APPROVED, | 585 | ... person2, reviewer=person2, status=TeamMembershipStatus.APPROVED, |
1595 | 586 | ... force_team_add=True) | 586 | ... force_team_add=True) |
1596 | 587 | >>> login_person(person2) | 587 | >>> login_person(person2) |
1597 | 588 | 588 | ||
1598 | === modified file 'lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.txt' | |||
1599 | --- lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.txt 2009-09-14 07:56:54 +0000 | |||
1600 | +++ lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.txt 2010-01-05 17:55:34 +0000 | |||
1601 | @@ -273,7 +273,7 @@ | |||
1602 | 273 | >>> login('foo.bar@canonical.com') | 273 | >>> login('foo.bar@canonical.com') |
1603 | 274 | >>> foobar = getUtility(IPersonSet).getByName('name16') | 274 | >>> foobar = getUtility(IPersonSet).getByName('name16') |
1604 | 275 | >>> mark = getUtility(IPersonSet).getByName('mark') | 275 | >>> mark = getUtility(IPersonSet).getByName('mark') |
1606 | 276 | >>> launchpad.addMember(mark, foobar) | 276 | >>> ignored = launchpad.addMember(mark, foobar) |
1607 | 277 | >>> import transaction | 277 | >>> import transaction |
1608 | 278 | >>> transaction.commit() | 278 | >>> transaction.commit() |
1609 | 279 | >>> logout() | 279 | >>> logout() |
1610 | 280 | 280 | ||
1611 | === modified file 'lib/lp/soyuz/stories/soyuz/xx-private-builds.txt' | |||
1612 | --- lib/lp/soyuz/stories/soyuz/xx-private-builds.txt 2009-09-17 14:45:15 +0000 | |||
1613 | +++ lib/lp/soyuz/stories/soyuz/xx-private-builds.txt 2010-01-05 17:55:34 +0000 | |||
1614 | @@ -51,7 +51,7 @@ | |||
1615 | 51 | ... IPersonSet).getByName("launchpad-buildd-admins") | 51 | ... IPersonSet).getByName("launchpad-buildd-admins") |
1616 | 52 | >>> from lp.registry.interfaces.person import ( | 52 | >>> from lp.registry.interfaces.person import ( |
1617 | 53 | ... TeamMembershipStatus) | 53 | ... TeamMembershipStatus) |
1619 | 54 | >>> buildd_admins.addMember( | 54 | >>> ignored = buildd_admins.addMember( |
1620 | 55 | ... name12, reviewer=name12, status=TeamMembershipStatus.APPROVED) | 55 | ... name12, reviewer=name12, status=TeamMembershipStatus.APPROVED) |
1621 | 56 | 56 | ||
1622 | 57 | >>> flush_database_updates() | 57 | >>> flush_database_updates() |
1623 | 58 | 58 | ||
1624 | === modified file 'lib/lp/translations/stories/standalone/xx-sourcepackage-export.txt' | |||
1625 | --- lib/lp/translations/stories/standalone/xx-sourcepackage-export.txt 2009-09-19 08:30:29 +0000 | |||
1626 | +++ lib/lp/translations/stories/standalone/xx-sourcepackage-export.txt 2010-01-05 17:55:34 +0000 | |||
1627 | @@ -97,7 +97,7 @@ | |||
1628 | 97 | >>> oofy = factory.makePerson(email='oofy@drones.example.com', | 97 | >>> oofy = factory.makePerson(email='oofy@drones.example.com', |
1629 | 98 | ... name='oofy', password='test', displayname='Oofy Prosser') | 98 | ... name='oofy', password='test', displayname='Oofy Prosser') |
1630 | 99 | >>> rosetta_admins = personset.getByName('rosetta-admins') | 99 | >>> rosetta_admins = personset.getByName('rosetta-admins') |
1632 | 100 | >>> rosetta_admins.addMember(oofy, carlos) | 100 | >>> ignored = rosetta_admins.addMember(oofy, carlos) |
1633 | 101 | 101 | ||
1634 | 102 | >>> gussie = factory.makePerson(email='gussie@drones.example.com', | 102 | >>> gussie = factory.makePerson(email='gussie@drones.example.com', |
1635 | 103 | ... name='gussie', password='test', displayname='Gussie Fink-Nottle') | 103 | ... name='gussie', password='test', displayname='Gussie Fink-Nottle') |
Summary
-------
This branch fixes a bunch of tests. Most of the fixes are simple search and
replace, but there are a good 731 lines that are more complicated, so they
need a review instead of a rubber stamp. I have included those diff lines
in this comment so you don't have to read the automated diff.
Implementation details ------- ------- -
-------
Display the correct informational message in the browser lp/registry/ browser/ team.py
corresponding to the new behavior for addMember().
lib/
I changed the owners of several teams in this test so that lp/registry/ doc/teammembers hip.txt
it tests the permissions more appropriately. Previously, it
was using foobar for everything, and that is a Launchpad admin,
so it effectively had admin access on all the teams.
lib/
I changed the user for these tests, since salgado is also a lp/registry/ stories/ team/xx- team-add- my-teams. txt
Launchpad admin.
lib/
Verify that the former members of a team are now only viewable lp/registry/ stories/ teammembership/ 20-managing- members. txt
by the admins of the team on the +members page.
lib/
I changed some of the teams involved in the tests and the logged-in lp/registry/ stories/ teammembership/ xx-add- member. txt lp/registry/ stories/ teammembership/ xx-private- membership. txt lp/registry/ stories/ webservice/ xx-private- membership. txt
user, since addMember() will fully add a team if the user is an
admin on both teams. If the user is only an admin on the team adding
another team, then addMember() will set the status to INVITED.
lib/
lib/
lib/
In the REST API, the logged-in user is passed in as the reviewer lp/registry/ tests/test_ teammembership. py
argument. Therefore, the no_priv user has to be used to create a
cyclical invitation as opposed to a cyclical active membership.
lib/
Tests
-----
./bin/test -vv -t registry
Pruned incremental diff ------- ------- -- registry/ browser/ team.py' registry/ browser/ team.py 2009-12-10 18:11:38 +0000 registry/ browser/ team.py 2010-01-04 17:12:48 +0000
-------
{{{
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -993,9 +993,11 @@
assert newmember != self.context, (
"Can't add team to itself: %s" % newmember)
- self.context. addMember( newmember, reviewer=self.user, TeamMembershipS tatus.APPROVED) addMember( TeamMembershipS tatus.APPROVED) tatus.INVITED:
newmember. unique_ displayname)
- status=
- if newmember.isTeam():
+ changed, new_status = self.context.
+ newmember, reviewer=self.user,
+ status=
+
+ if new_status == TeamMembershipS
msg = "%s has been invited to join this team." % (
else:
=== modified file 'lib/lp/ registry/ doc/teammembers hip.txt' registry/ doc/teammembers hip.txt 2009-12-16 02:22:29 +0000 registry/ doc/teammembers hip.txt 2010-01-04 17:12:47 +0000 launchpad. interfaces import IPersonSet IPersonSet) getByName( 'name16' ) getByName( 'jblack' )
--- lib/lp/
+++ lib/lp/
@@ -22,23 +22,28 @@
>>> from zope.component import getUtility
>>> from canonical.
>>> personset = getUtility(
- >>> foobar = personset.
- >>> reviewer = foobar
+ >>> jblack = personset.
+ >>> nop...