def test_does_fire_jobs(self, check_project_alerts): project = self.create_project() check_alerts() check_project_alerts.delay.assert_any_call(project_id=project.id, expires=120)
def test_does_fire_jobs(self, check_project_alerts): project = self.create_project() check_alerts() check_project_alerts.apply_async.assert_any_call( kwargs=dict(project_id=project.id), expires=120, )
def test_does_fire_jobs(self, check_project_alerts): project = self.create_project() check_alerts() check_project_alerts.delay.assert_any_call( project_id=project.id, expires=120 )
def test_does_fire_jobs(self, check_project_alerts): when = timezone.now() self.create_counts(when, 50, 5, normalize=False) with mock.patch('sentry.tasks.check_alerts.timezone.now') as now: now.return_value = when check_alerts() now.assert_called_once_with() check_project_alerts.delay.assert_called_once_with( project_id=self.project.id, when=when - timedelta(minutes=1), count=10, expires=120)
def test_does_fire_jobs(self, check_project_alerts): when = timezone.now() self.create_counts(when, 50, 5, normalize=False) with mock.patch('sentry.tasks.check_alerts.timezone.now') as now: now.return_value = when check_alerts() now.assert_called_once_with() check_project_alerts.delay.assert_called_once_with( project_id=self.project.id, when=when - timedelta(minutes=1), count=10, expires=120 )