Ejemplo n.º 1
0
    def test_gateway(self, logger):
        fake = Fake()

        fake.make_call(device=Mock(number="+123"), token="654321")
        logger.info.assert_called_with('Fake call to %s: "Your token is: %s"', "+123", "654321")

        fake.send_sms(device=Mock(number="+123"), token="654321")
        logger.info.assert_called_with('Fake SMS to %s: "Your token is: %s"', "+123", "654321")
Ejemplo n.º 2
0
    def test_gateway(self, logger):
        fake = Fake()

        for code in ['654321', '87654321']:
            fake.make_call(device=Mock(number=PhoneNumber.from_string('+123')), token=code)
            logger.info.assert_called_with(
                'Fake call to %s: "Your token is: %s"', '+123', code)

            fake.send_sms(device=Mock(number=PhoneNumber.from_string('+123')), token=code)
            logger.info.assert_called_with(
                'Fake SMS to %s: "Your token is: %s"', '+123', code)
Ejemplo n.º 3
0
    def test_gateway(self, logger):
        fake = Fake()

        fake.make_call(device=Mock(number='+123'), token='654321')
        logger.info.assert_called_with('Fake call to %s: "Your token is: %s"',
                                       '+123', '654321')

        fake.send_sms(device=Mock(number='+123'), token='654321')
        logger.info.assert_called_with('Fake SMS to %s: "Your token is: %s"',
                                       '+123', '654321')
Ejemplo n.º 4
0
    def test_gateway(self, logger):
        fake = Fake()

        for code in ['654321', '87654321']:
            fake.make_call(device=Mock(number=PhoneNumber.from_string('+123')), token=code)
            logger.info.assert_called_with(
                'Fake call to %s: "Your token is: %s"', '+123', code)

            fake.send_sms(device=Mock(number=PhoneNumber.from_string('+123')), token=code)
            logger.info.assert_called_with(
                'Fake SMS to %s: "Your token is: %s"', '+123', code)