~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/model/tests/test_personsubscriptioninfo.py

Merged db-devel into replication.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
    IVirtualSubscriptionInfoCollection,
17
17
    )
18
18
from lp.bugs.model.personsubscriptioninfo import PersonSubscriptions
 
19
from lp.registry.interfaces.person import TeamSubscriptionPolicy
19
20
from lp.registry.interfaces.teammembership import TeamMembershipStatus
20
21
from lp.testing import (
21
22
    person_logged_in,
460
461
    def test_owner_through_team(self):
461
462
        # Bug is targeted to a pillar with no supervisor set.
462
463
        target = self.bug.default_bugtask.target
463
 
        team = self.factory.makeTeam(members=[self.subscriber])
 
464
        team = self.factory.makeTeam(
 
465
            members=[self.subscriber],
 
466
            subscription_policy=TeamSubscriptionPolicy.RESTRICTED)
464
467
        removeSecurityProxy(target).owner = team
465
468
        # Load a `PersonSubscriptionInfo`s for target.owner and a bug.
466
469
        self.subscriptions.reload()
477
480
    def test_owner_through_team_as_admin(self):
478
481
        # Bug is targeted to a pillar with no supervisor set.
479
482
        target = self.bug.default_bugtask.target
480
 
        team = self.factory.makeTeam()
 
483
        team = self.factory.makeTeam(
 
484
            subscription_policy=TeamSubscriptionPolicy.RESTRICTED)
481
485
        with person_logged_in(team.teamowner):
482
486
            team.addMember(self.subscriber, team.teamowner,
483
487
                           status=TeamMembershipStatus.ADMIN)