예제 #1
0
 def _check_get_handlers(self, *args):
     with override_settings(**self.settings):
         with mock.patch('rapidsms.contrib.handlers.utils.warn') as warn:
             handlers = get_handlers()
     self.assertEqual(set(handlers), set(args))
     # If RAPIDSMS_HANDLERS is not defined, a deprecation warning is issued
     self.assertEqual(warn.called, 'RAPIDSMS_HANDLERS' not in self.settings)
예제 #2
0
 def _check_get_handlers(self, *args):
     with override_settings(**self.settings):
         with mock.patch('rapidsms.contrib.handlers.utils.warn') as warn:
             handlers = get_handlers()
     self.assertEqual(set(handlers), set(args))
     # If RAPIDSMS_HANDLERS is not defined, a deprecation warning is issued
     self.assertEqual(warn.called, 'RAPIDSMS_HANDLERS' not in self.settings)
예제 #3
0
    def __init__(self, router):
        super(App, self).__init__(router)

        self.handlers = get_handlers()

        if hasattr(settings, 'RAPIDSMS_HELP_KEYWORDS'):
            self.triggers = settings.RAPIDSMS_HELP_KEYWORDS
        else:
            self.triggers = ['HELP', 'AIDE']

        self._gather_keywords()
예제 #4
0
파일: utils.py 프로젝트: komputa/rapidsms
 def _check_get_handlers(self, *args):
     with override_settings(**self.settings):
         handlers = get_handlers()
         self.assertEqual(len(handlers), len(args))
         for handler in args:
             self.assertTrue(handler in handlers)
예제 #5
0
 def _check_get_handlers(self, *args):
     with override_settings(**self.settings):
         handlers = get_handlers()
         self.assertEqual(len(handlers), len(args))
         for handler in args:
             self.assertTrue(handler in handlers)