def setUp(self): super(TestRenderErrors, self).setUp() AppStatus.create() self.codes = [401, 403, 404, 413, 500] for i in self.codes: self.client.application.add_url_rule('/' + str(i), str(i), self.build_rule(i))
def setUp(self): super(TestRenderErrors, self).setUp() AppStatus.create() self.codes = [401, 403, 404, 413, 500] for i in self.codes: self.client.application.add_url_rule( '/' + str(i), str(i), self.build_rule(i) )
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)