~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/browser/tests/test_sourcepackagerecipe.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2012-01-04 12:04:29 UTC
  • mfrom: (14625.1.2 hide-forbidden-sprbs)
  • Revision ID: launchpad@pqm.canonical.com-20120104120429-9up4kvcasxykd355
[r=jtv][bug=882834] Do not show SourcePackageRecipeBuilds that the
        user can't see in the SourcePackageRecipe views.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2010 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2010-2012 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
# pylint: disable-msg=F0401,E1002
4
4
 
1170
1170
              Secret PPA chocolate - 0\+r42 on 2010-04-16 buildlog \(.*\) i386
1171
1171
            Request build\(s\)""", self.getMainText(recipe))
1172
1172
 
 
1173
    def test_index_success_with_sprb_into_private_ppa(self):
 
1174
        # The index page hides builds into archives the user can't view.
 
1175
        recipe = self.makeRecipe()
 
1176
        archive = self.factory.makeArchive(private=True)
 
1177
        sprb = removeSecurityProxy(
 
1178
            self.factory.makeSourcePackageRecipeBuild(
 
1179
                recipe=recipe, distroseries=self.squirrel, archive=archive))
 
1180
        sprb.status = BuildStatus.FULLYBUILT
 
1181
        sprb.date_started = datetime(2010, 04, 16, tzinfo=UTC)
 
1182
        sprb.date_finished = datetime(2010, 04, 16, tzinfo=UTC)
 
1183
        sprb.log = self.factory.makeLibraryFileAlias()
 
1184
        self.assertIn(
 
1185
            "This recipe has not been built yet.", self.getMainText(recipe))
 
1186
 
1173
1187
    def test_index_no_builds(self):
1174
1188
        """A message should be shown when there are no builds."""
1175
1189
        recipe = self.makeRecipe()