示例#1
0
class TestResource(test.TestCase):
    def setUp(self):
        self.res = RefundViewSet()

    @mock.patch.object(settings, 'BANGO_FAKE_REFUNDS', False)
    def test_not_faked(self):
        ok_(not self.res.get_client({}))

    @mock.patch.object(settings, 'BANGO_FAKE_REFUNDS', True)
    def test_partially_faked(self):
        res = self.res.get_client({})
        eq_(res.mock_results('foo')['responseCode'], 'OK')

    @mock.patch.object(settings, 'BANGO_FAKE_REFUNDS', True)
    def test_faked(self):
        res = self.res.get_client({'fake_response': {'responseCode': 'foo'}})
        eq_(res.mock_results('foo')['responseCode'], 'foo')
示例#2
0
class TestResource(test.TestCase):
    def setUp(self):
        self.res = RefundViewSet()

    @mock.patch.object(settings, "BANGO_FAKE_REFUNDS", False)
    def test_not_faked(self):
        ok_(not self.res.get_client({}))

    @mock.patch.object(settings, "BANGO_FAKE_REFUNDS", True)
    def test_partially_faked(self):
        res = self.res.get_client({})
        eq_(res.mock_results("foo")["responseCode"], "OK")

    @mock.patch.object(settings, "BANGO_FAKE_REFUNDS", True)
    def test_faked(self):
        res = self.res.get_client({"fake_response": {"responseCode": "foo"}})
        eq_(res.mock_results("foo")["responseCode"], "foo")
示例#3
0
class TestResource(test.TestCase):

    def setUp(self):
        self.res = RefundViewSet()

    @mock.patch.object(settings, 'BANGO_FAKE_REFUNDS', False)
    def test_not_faked(self):
        ok_(not self.res.get_client({}))

    @mock.patch.object(settings, 'BANGO_FAKE_REFUNDS', True)
    def test_partially_faked(self):
        res = self.res.get_client({})
        eq_(res.mock_results('foo')['responseCode'], 'OK')

    @mock.patch.object(settings, 'BANGO_FAKE_REFUNDS', True)
    def test_faked(self):
        res = self.res.get_client({'fake_response': {'responseCode': 'foo'}})
        eq_(res.mock_results('foo')['responseCode'], 'foo')
示例#4
0
 def setUp(self):
     self.res = RefundViewSet()
示例#5
0
 def setUp(self):
     self.res = RefundViewSet()