~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/browser/tests/test_distroseries.py

Add DistroSeriesInitializeView.rebuilding_allowed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
456
456
                u"javascript-disabled",
457
457
                message.get("class").split())
458
458
 
 
459
    def test_rebuilding_allowed(self):
 
460
        # If the distro has no initialised series, rebuilding is allowed.
 
461
        distroseries = self.factory.makeDistroSeries()
 
462
        self.factory.makeDistroSeries(
 
463
            distribution=distroseries.distribution)
 
464
        view = create_initialized_view(distroseries, "+initseries")
 
465
 
 
466
        self.assertTrue(view.rebuilding_allowed)
 
467
 
 
468
    def test_rebuilding_not_allowed(self):
 
469
        # If the distro has an initialised series, no rebuilding is allowed.
 
470
        distroseries = self.factory.makeDistroSeries()
 
471
        another_distroseries = self.factory.makeDistroSeries(
 
472
            distribution=distroseries.distribution)
 
473
        self.factory.makeSourcePackagePublishingHistory(
 
474
            distroseries=another_distroseries)
 
475
        view = create_initialized_view(distroseries, "+initseries")
 
476
 
 
477
        self.assertFalse(view.rebuilding_allowed)
 
478
 
459
479
 
460
480
class DistroSeriesDifferenceMixin:
461
481
    """A helper class for testing differences pages"""