Example #1
0
    def setUp(self):
        super(WebSmsGateInterfaceTest, self).setUp()
        bad_config = "[Provider]\n" + \
        "http_username = user\n" + \
        "http_password = bad_password\n"

        conf_parser = ConfigParser.RawConfigParser()
        conf_parser.readfp(io.BytesIO(bad_config))

        self.overriders = {'test': 1}

        self.gi = WebSmsGateInterface(conf_parser)
        SmsLog.objects.all().delete()
Example #2
0
    def setUp(self):
        super(WebSmsGateInterfaceTest, self).setUp()
        bad_config = "[Provider]\n" + \
        "http_username = user\n" + \
        "http_password = bad_password\n"

        conf_parser = ConfigParser.RawConfigParser()
        conf_parser.readfp(io.BytesIO(bad_config))

        self.overriders = {
            'test': 1
        }

        self.gi = WebSmsGateInterface(conf_parser)
        SmsLog.objects.all().delete()
Example #3
0
class WebSmsGateInterfaceTest(BaseRestTestCase):
    def setUp(self):
        super(WebSmsGateInterfaceTest, self).setUp()
        bad_config = "[Provider]\n" + \
        "http_username = user\n" + \
        "http_password = bad_password\n"

        conf_parser = ConfigParser.RawConfigParser()
        conf_parser.readfp(io.BytesIO(bad_config))

        self.overriders = {'test': 1}

        self.gi = WebSmsGateInterface(conf_parser)
        SmsLog.objects.all().delete()

    def test_send(self):
        self.assertRaises(ProviderFailure,
                          lambda: self.gi.send(self.qi, **self.overriders))
        self.assertTrue(SmsLog.objects.all().exists())

        l = SmsLog.objects.get()
        self.assertTrue(l.text.startswith('Error sending'))
Example #4
0
class WebSmsGateInterfaceTest(BaseRestTestCase):
    def setUp(self):
        super(WebSmsGateInterfaceTest, self).setUp()
        bad_config = "[Provider]\n" + \
        "http_username = user\n" + \
        "http_password = bad_password\n"

        conf_parser = ConfigParser.RawConfigParser()
        conf_parser.readfp(io.BytesIO(bad_config))

        self.overriders = {
            'test': 1
        }

        self.gi = WebSmsGateInterface(conf_parser)
        SmsLog.objects.all().delete()

    def test_send(self):
        self.assertRaises(ProviderFailure, lambda: self.gi.send(self.qi, **self.overriders))
        self.assertTrue(SmsLog.objects.all().exists())

        l = SmsLog.objects.get()
        self.assertTrue(l.text.startswith('Error sending'))