~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-09-14 13:26:42 UTC
  • mfrom: (13646.11.20 denorm-bspph-garbo)
  • Revision ID: launchpad@pqm.canonical.com-20110914132642-ubgik3qizdj05o62
[r=jtv][bug=826516][incr] Add a garbo job that will populate
        BPPH.binarypackagename and SPPH.sourcepackagename.

Show diffs side-by-side

added added

removed removed

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