~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/model/tests/test_branchcollection.py

  • Committer: Benji York
  • Date: 2011-08-01 12:51:12 UTC
  • mfrom: (13572 devel)
  • mto: This revision was merged to the branch mainline in revision 13573.
  • Revision ID: benji.york@canonical.com-20110801125112-a4euql70924suzb6
mergeĀ fromĀ devel

Show diffs side-by-side

added added

removed removed

Lines of Context:
507
507
        branches = all_branches.targetedBy(registrant, since=since)
508
508
        self.assertEqual([], list(branches.getBranches()))
509
509
 
 
510
    def test_linkedToBugs(self):
 
511
        # BranchCollection.linkedToBugs() returns all the branches linked
 
512
        # to a given set of bugs.
 
513
        all_branches = self.all_branches
 
514
        bug = self.factory.makeBug()
 
515
        linked_branch = self.factory.makeBranch()
 
516
        unlinked_branch = self.factory.makeBranch()
 
517
        with person_logged_in(linked_branch.owner):
 
518
            bug.linkBranch(linked_branch, linked_branch.owner)
 
519
        branches = all_branches.linkedToBugs([bug])
 
520
        self.assertContentEqual([linked_branch], branches.getBranches())
 
521
        self.assertNotIn(unlinked_branch, list(branches.getBranches()))
 
522
 
510
523
 
511
524
class TestGenericBranchCollectionVisibleFilter(TestCaseWithFactory):
512
525