Exemple #1
0
    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')
Exemple #2
0
 def test_valid_settings(self):
     with self.settings(STATUS_APP_RECEIVERS= ['status_app.receiver.sample_receiver']):
         try:
             load_receivers()
         except ImproperlyConfigured:
             self.fail('Could not load sample_receiver')
Exemple #3
0
 def test_invalid_settings(self):
     with contextlib.nested(self.settings(STATUS_APP_RECEIVERS=['status_app.receiver.missing_receiver']),
                            self.assertRaises(ImproperlyConfigured)):
         load_receivers()
Exemple #4
0
from status_app.receiver_initialization import load_receivers

load_receivers()