20
20
layer = DatabaseFunctionalLayer
22
def test_private_team_non_member(self):
23
# Maintainers can not be private teams. If the uploader isn't set,
24
# or isn't a member, the rejection message is delibrately vague.
22
def test_private_team_maintainer(self):
23
# Maintainers can not be private teams.
25
24
with celebrity_logged_in('admin'):
26
25
team = self.factory.makeTeam(
27
26
email="foo@bar.com", visibility=PersonVisibility.PRIVATE)
28
27
sigfile = SignableTagFile()
29
sigfile.changes = SignableTagFile()
30
sigfile.changes.changed_by = {}
31
28
self.assertRaisesWithContent(
32
29
UploadError, 'Invalid Maintainer.', sigfile.parseAddress,
35
def test_private_team_member(self):
36
# Maintainers can not be private teams. If the uploader is a member
37
# of the team, the rejection message can be clear.
38
uploader = self.factory.makePerson()
39
with celebrity_logged_in('admin'):
40
team = self.factory.makeTeam(
41
email="foo@bar.com", visibility=PersonVisibility.PRIVATE,
43
sigfile = SignableTagFile()
44
sigfile.changes = SignableTagFile()
45
sigfile.changes.changed_by = {'person': uploader}
46
self.assertRaisesWithContent(
47
UploadError, 'Maintainer can not be set to a private team.',
48
sigfile.parseAddress, "foo@bar.com")