6
6
from zope.component import getUtility
7
7
from zope.security.proxy import removeSecurityProxy
9
from canonical.launchpad.testing.pages import (
9
13
from canonical.launchpad.webapp.publisher import canonical_url
10
14
from canonical.testing.layers import DatabaseFunctionalLayer
11
15
from lp.registry.browser.team import TeamOverviewMenu
16
from lp.registry.interfaces.person import PersonVisibility
12
17
from lp.registry.interfaces.persontransferjob import IPersonMergeJobSource
13
18
from lp.registry.interfaces.teammembership import (
14
19
ITeamMembershipSet,
183
188
'in a few minutes.')
184
189
self.assertEqual(1, len(notifications))
185
190
self.assertEqual(message, notifications[0].message)
192
def test_user_without_launchpad_view(self):
193
# When the user does not have launchpad.View on the context,
194
user = self.factory.makePerson()
195
owner = self.factory.makePerson()
196
with person_logged_in(owner):
197
team = self.factory.makeTeam(
198
displayname='Waffles', owner=owner,
199
visibility=PersonVisibility.PRIVATE)
200
archive = self.factory.makeArchive(private=True, owner=team)
201
archive.newSubscription(user, registrant=owner)
202
with person_logged_in(user):
203
view = create_initialized_view(
204
team, name="+index", server_url=canonical_url(team),
205
path_info='', principal=user)
206
document = find_tag_by_id(view(), 'document')
207
self.assertIsNone(document.find(True, id='side-portlets'))
208
self.assertIsNone(document.find(True, id='registration'))
210
extract_text(document.find(True, id='maincontent')),
211
'The information in this page is not shared with you.')