def test_valid_settings(self): with self.settings(STATUS_APP_DISPATCHERS= ['status_app.dispatcher.memory.dispatch']): clear_all_events() dispatch('dt_test_settings', RawEvent.PASS_FAIL, timezone.now(), True, '', 'test') all_events = get_all_events() self.assertEquals(len(all_events), 1) self.assertEquals(all_events[0][0], 'dt_test_settings')
def test_request(self): with contextlib.nested(self.settings(STATUS_APP_RECEIVERS=['status_app.receiver.sample_receiver']), self.settings(STATUS_APP_DISPATCHERS=['status_app.dispatcher.memory.dispatch'])): clear_all_events() load_receivers() c = Client() c.get('/status') all_events = get_all_events() self.assertEquals(len(all_events), 1) self.assertEquals(all_events[0][0], 'test_request_finished')