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')
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")
def setUp(self): self.res = RefundViewSet()