~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

[r=allenap][no-qa] Get rid of factory.make[Ubuntu]DistroRelease. And
        some lint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
"""Tests for branch collections."""
77
77
 
78
78
    def test_distro_series(self):
79
79
        # A distro series can be adapted to a branch collection.
80
 
        distro_series = self.factory.makeDistroRelease()
 
80
        distro_series = self.factory.makeDistroSeries()
81
81
        collection = IBranchCollection(distro_series, None)
82
82
        self.assertIsNot(None, collection)
83
83
 
272
272
        # 'inDistribution' returns a new collection that only has branches
273
273
        # that are source package branches associated with distribution series
274
274
        # for the distribution specified.
275
 
        series_one = self.factory.makeDistroRelease()
 
275
        series_one = self.factory.makeDistroSeries()
276
276
        distro = series_one.distribution
277
 
        series_two = self.factory.makeDistroRelease(distribution=distro)
 
277
        series_two = self.factory.makeDistroSeries(distribution=distro)
278
278
        # Make two branches in the same distribution, but different series and
279
279
        # source packages.
280
280
        branch = self.factory.makePackageBranch(distroseries=series_one)
291
291
        # 'inDistroSeries' returns a new collection that only has branches
292
292
        # that are source package branches associated with the distribution
293
293
        # series specified.
294
 
        series_one = self.factory.makeDistroRelease()
295
 
        series_two = self.factory.makeDistroRelease(
 
294
        series_one = self.factory.makeDistroSeries()
 
295
        series_two = self.factory.makeDistroSeries(
296
296
            distribution=series_one.distribution)
297
297
        # Make two branches in the same distroseries, but different source
298
298
        # packages.
343
343
        # 'inDistributionSourcePackage' returns a new collection that only has
344
344
        # branches for the source package across any distroseries of the
345
345
        # distribution.
346
 
        series_one = self.factory.makeDistroRelease()
347
 
        series_two = self.factory.makeDistroRelease(
 
346
        series_one = self.factory.makeDistroSeries()
 
347
        series_two = self.factory.makeDistroSeries(
348
348
            distribution=series_one.distribution)
349
349
        package = self.factory.makeSourcePackageName()
350
350
        sourcepackage_one = self.factory.makeSourcePackage(