~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Curtis Hovey
  • Date: 2011-09-19 20:53:38 UTC
  • mto: This revision was merged to the branch mainline in revision 14002.
  • Revision ID: curtis.hovey@canonical.com-20110919205338-13ufigsnsbt71gzq
Moved official DSP branch into SourcePackage becaus it is the
underlying object that setBranch() is called with in the two
IHasLinkedBranches implementations that need a DSP.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
from lp.registry.interfaces.distribution import NoPartnerArchive
25
25
from lp.registry.interfaces.pocket import PackagePublishingPocket
26
26
from lp.registry.interfaces.series import SeriesStatus
 
27
from lp.registry.model.distributionsourcepackage import (
 
28
    DistributionSourcePackage,
 
29
    )
27
30
from lp.registry.model.packaging import Packaging
28
31
from lp.soyuz.enums import (
29
32
    ArchivePurpose,
81
84
        with person_logged_in(sourcepackage.distribution.owner):
82
85
            sourcepackage.setBranch(pocket, branch, registrant)
83
86
        self.assertEqual(branch, sourcepackage.getBranch(pocket))
 
87
        # A DSP was created for the official branch.
 
88
        new_dsp = DistributionSourcePackage._get(
 
89
            sourcepackage.distribution, sourcepackage.sourcepackagename)
 
90
        self.assertIsNot(None, new_dsp)
84
91
 
85
92
    def test_change_branch_once_set(self):
86
93
        # We can change the official branch for a a pocket of a source package