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)
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)