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