~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/scripts/tests/test_garbo.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-14 03:02:38 UTC
  • mfrom: (14493.2.1 bug-849683-populators)
  • Revision ID: launchpad@pqm.canonical.com-20111214030238-uam88gduz2t5co4k
[r=gmb][bug=849683] Retire {Binary,
 Source}PackagePublishingHistory.{binary,
 source}packagename populators from garbo-hourly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1026
1026
        self.runDaily()
1027
1027
        self.assertEqual(0, unreferenced_msgsets.count())
1028
1028
 
1029
 
    def test_SPPH_and_BPPH_populator(self):
1030
 
        # If SPPHs (or BPPHs) do not have sourcepackagename (or
1031
 
        # binarypackagename) set, the populator will set it.
1032
 
        LaunchpadZopelessLayer.switchDbUser('testadmin')
1033
 
        spph = self.factory.makeSourcePackagePublishingHistory()
1034
 
        spn = spph.sourcepackagename
1035
 
        removeSecurityProxy(spph).sourcepackagename = None
1036
 
        bpph = self.factory.makeBinaryPackagePublishingHistory()
1037
 
        bpn = bpph.binarypackagename
1038
 
        removeSecurityProxy(bpph).binarypackagename = None
1039
 
        transaction.commit()
1040
 
        self.assertIs(None, spph.sourcepackagename)
1041
 
        self.assertIs(None, bpph.binarypackagename)
1042
 
        self.runHourly()
1043
 
        self.assertEqual(spn, spph.sourcepackagename)
1044
 
        self.assertEqual(bpn, bpph.binarypackagename)
1045
 
 
1046
1029
 
1047
1030
class TestGarboTasks(TestCaseWithFactory):
1048
1031
    layer = LaunchpadZopelessLayer