示例#1
0
 def setUp(self):
     self.contact = self.create_contact()
     self.backend = self.create_backend(data={'name': 'mockbackend'})
     self.unreg_conn = self.create_connection({'backend': self.backend})
     self.reg_conn = self.create_connection({'contact': self.contact,
                                             'backend': self.backend})
     self.router = MockRouter()
     self.app = WBApp(router=self.router)
示例#2
0
class RemindersConfirmHandlerTest(RemindersCreateDataTest):

    def setUp(self):
        self.contact = self.create_contact()
        self.backend = self.create_backend(data={'name': 'mockbackend'})
        self.unreg_conn = self.create_connection({'backend': self.backend})
        self.reg_conn = self.create_connection({'contact': self.contact,
                                                'backend': self.backend})
        self.router = MockRouter()
        self.app = WBApp(router=self.router)

    def _send(self, conn, text):
        msg = IncomingMessage(conn, text)
        self.app.handle(msg)
        return msg

    def test_good_registration(self):
        """ test the response from an unregistered user """
        msg = self._send(self.unreg_conn, '1234')
        self.assertEqual(len(msg.responses), 1)
        self.assertEqual(msg.responses[0].text,
                         self.app.STRING_REG_REQUEST_CONFIRM)