~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/tests/test_person.py

Merged replication into pending-db-changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
520
520
            0,
521
521
            synchronised_spphs.count())
522
522
 
 
523
    def test_product_isAnyPillarOwner(self):
 
524
        # Test isAnyPillarOwner for products
 
525
        person = self.factory.makePerson()
 
526
        owner = self.factory.makePerson()
 
527
        self.factory.makeProduct(owner=owner)
 
528
        self.assertTrue(owner.isAnyPillarOwner())
 
529
        self.assertFalse(person.isAnyPillarOwner())
 
530
 
 
531
    def test_projectgroup_isAnyPillarOwner(self):
 
532
        # Test isAnyPillarOwner for project groups
 
533
        person = self.factory.makePerson()
 
534
        owner = self.factory.makePerson()
 
535
        self.factory.makeProject(owner=owner)
 
536
        self.assertTrue(owner.isAnyPillarOwner())
 
537
        self.assertFalse(person.isAnyPillarOwner())
 
538
 
 
539
    def test_distribution_isAnyPillarOwner(self):
 
540
        # Test isAnyPillarOwner for distributions
 
541
        person = self.factory.makePerson()
 
542
        owner = self.factory.makePerson()
 
543
        self.factory.makeDistribution(owner=owner)
 
544
        self.assertTrue(owner.isAnyPillarOwner())
 
545
        self.assertFalse(person.isAnyPillarOwner())
 
546
 
 
547
    def test_product_isAnySecurityContact(self):
 
548
        # Test isAnySecurityContact for products
 
549
        person = self.factory.makePerson()
 
550
        contact = self.factory.makePerson()
 
551
        self.factory.makeProduct(security_contact=contact)
 
552
        self.assertTrue(contact.isAnySecurityContact())
 
553
        self.assertFalse(person.isAnySecurityContact())
 
554
 
 
555
    def test_distribution_isAnySecurityContact(self):
 
556
        # Test isAnySecurityContact for distributions
 
557
        person = self.factory.makePerson()
 
558
        contact = self.factory.makePerson()
 
559
        self.factory.makeDistribution(security_contact=contact)
 
560
        self.assertTrue(contact.isAnySecurityContact())
 
561
        self.assertFalse(person.isAnySecurityContact())
 
562
 
523
563
 
524
564
class TestPersonStates(TestCaseWithFactory):
525
565