~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/browser/tests/test_securitycontact.py

Merged db-devel into replication.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
from zope.app.form.interfaces import ConversionError
9
9
 
10
10
from canonical.testing.layers import DatabaseFunctionalLayer
 
11
from lp.registry.interfaces.person import TeamSubscriptionPolicy
11
12
from lp.testing import (
12
13
    login,
13
14
    login_person,
26
27
            name='splat', displayname='<splat />')
27
28
        self.product = self.factory.makeProduct(
28
29
            name="boing", displayname='<boing />', owner=self.owner)
29
 
        self.team = self.factory.makeTeam(name='thud', owner=self.owner)
 
30
        self.team = self.factory.makeTeam(
 
31
            name='thud', owner=self.owner,
 
32
            subscription_policy=TeamSubscriptionPolicy.RESTRICTED)
30
33
        login_person(self.owner)
31
34
 
32
35
    def _makeForm(self, person):
96
99
        self.assertEqual(expected, notifications.pop().message)
97
100
 
98
101
    def test_owner_cannot_appoint_another_team(self):
99
 
        team = self.factory.makeTeam(name='smack', displayname='<smack />')
 
102
        team = self.factory.makeTeam(
 
103
            name='smack', displayname='<smack />',
 
104
            subscription_policy=TeamSubscriptionPolicy.RESTRICTED)
100
105
        form = self._makeForm(team)
101
106
        view = create_initialized_view(
102
107
            self.product, name='+securitycontact', form=form)
143
148
        self.assertEqual(another_user, self.product.security_contact)
144
149
 
145
150
    def test_admin_appoint_another_team(self):
146
 
        another_team = self.factory.makeTeam()
 
151
        another_team = self.factory.makeTeam(
 
152
            subscription_policy=TeamSubscriptionPolicy.RESTRICTED)
147
153
        login('admin@canonical.com')
148
154
        form = self._makeForm(another_team)
149
155
        view = create_initialized_view(