~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/archiveuploader/tests/test_private_maintainers.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2012-01-05 09:11:42 UTC
  • mfrom: (14632.2.3 forbid-private-maintainers)
  • Revision ID: launchpad@pqm.canonical.com-20120105091142-j89u7at07xmn8inm
[r=lifeless][bug=611617] Better exception if the maintainer is
        private.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2012 Canonical Ltd.  This software is licensed under the
 
2
# GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
__metaclass__ = type
 
5
 
 
6
from lp.archiveuploader.dscfile import SignableTagFile
 
7
from lp.archiveuploader.nascentuploadfile import UploadError
 
8
from lp.registry.interfaces.person import PersonVisibility
 
9
from lp.testing import (
 
10
    celebrity_logged_in,
 
11
    TestCaseWithFactory,
 
12
    )
 
13
from lp.testing.layers import DatabaseFunctionalLayer
 
14
 
 
15
 
 
16
class TestPrivateMaintainers(TestCaseWithFactory):
 
17
 
 
18
    layer = DatabaseFunctionalLayer
 
19
 
 
20
    def test_private_team_maintainer(self):
 
21
        # Maintainers can not be private teams.
 
22
        with celebrity_logged_in('admin'):
 
23
            self.factory.makeTeam(
 
24
                email="foo@bar.com", visibility=PersonVisibility.PRIVATE)
 
25
        sigfile = SignableTagFile()
 
26
        self.assertRaisesWithContent(
 
27
            UploadError, 'Invalid Maintainer.', sigfile.parseAddress,
 
28
            "foo@bar.com")