コード例 #1
0
    def test_beacon_nightly_update(self, status, run_job):
        status.query.first.return_value = AppStatus()
        AppStatus.update = Mock()

        biweekly = BeaconBiweeklyDigestJob()
        biweekly.run_job(JobStatus(status='new'))
        self.assertFalse(AppStatus.update.called)

        biweekly.run_job(JobStatus(status='new'))
        self.assertTrue(AppStatus.update.called)
コード例 #2
0
 def test_beacon_biweekly_correct_opportunities(self):
     AppStatus.create(last_beacon_newsletter=self.yesterday)
     biweekly = BeaconBiweeklyDigestJob()
     opportunities = biweekly.get_opportunities()
     self.assertEquals(len(opportunities), 1)