summaryrefslogtreecommitdiff
path: root/payments/stripe
diff options
context:
space:
mode:
authorPatryk Zawadzki <patrys@room-303.com>2015-10-16 16:11:46 +0200
committerPatryk Zawadzki <patrys@room-303.com>2015-10-16 16:11:46 +0200
commit62256b3ac37d74b120e9f3b7a8a7006b6447350a (patch)
tree70dd42f44b39ebfa1b3d9e47ad1e13c20e25b03c /payments/stripe
parent58bf438fed683e8a1466f9112f3e616732c7ccaf (diff)
downloaddjango-payments-taler-62256b3ac37d74b120e9f3b7a8a7006b6447350a.tar.gz
django-payments-taler-62256b3ac37d74b120e9f3b7a8a7006b6447350a.tar.bz2
django-payments-taler-62256b3ac37d74b120e9f3b7a8a7006b6447350a.zip
Replace MagicMocks with Mocks
This catches way more errors. 0.7.3
Diffstat (limited to 'payments/stripe')
-rw-r--r--payments/stripe/forms.py2
-rw-r--r--payments/stripe/test_stripe.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/payments/stripe/forms.py b/payments/stripe/forms.py
index 88f59d8..c19b5f1 100644
--- a/payments/stripe/forms.py
+++ b/payments/stripe/forms.py
@@ -56,7 +56,7 @@ class PaymentForm(BasePaymentForm):
self._handle_potentially_fraudulent_charge(
self.charge, commit=False)
# The card has been declined
- self._errors['__all__'] = self.error_class([e])
+ self._errors['__all__'] = self.error_class([str(e)])
self.payment.change_status('error', str(e))
else:
msg = _('This payment has already been processed.')
diff --git a/payments/stripe/test_stripe.py b/payments/stripe/test_stripe.py
index cce6c7f..05bb47c 100644
--- a/payments/stripe/test_stripe.py
+++ b/payments/stripe/test_stripe.py
@@ -2,7 +2,7 @@
from __future__ import unicode_literals
from contextlib import contextmanager
-from mock import patch, MagicMock
+from mock import patch, Mock
from unittest import TestCase
import stripe
@@ -15,7 +15,7 @@ SECRET_KEY = '1234abcd'
PUBLIC_KEY = 'abcd1234'
-class Payment(MagicMock):
+class Payment(Mock):
id = 1
description = 'payment'