~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Raphael Badin
  • Date: 2012-01-06 08:27:55 UTC
  • mfrom: (14513.5.4 builder-history-lfa)
  • mto: This revision was merged to the branch mainline in revision 14654.
  • Revision ID: raphael.badin@canonical.com-20120106082755-95a0eh6nakv5hj3b
Merge devel.

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")