Changeset 12326 for main/waeup.ikoba/trunk/src/waeup/ikoba
- Timestamp:
- 26 Dec 2014, 11:28:59 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/payments
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/payments/paypal.py
r12325 r12326 1146 1146 if (payee is not None) and (not IPayee.providedBy(payee)): 1147 1147 payee = IPayee(payee) 1148 credit_card = self.get_credit_card(payer.payer_id) 1149 if credit_card is None: 1150 raise ValueError("Payer %s has no credit card." % payer.payer_id) 1148 1151 return None 1149 1152 -
main/waeup.ikoba/trunk/src/waeup/ikoba/payments/tests/test_paypal.py
r12325 r12326 34 34 from waeup.ikoba.interfaces import IPayPalConfig 35 35 from waeup.ikoba.payments.interfaces import ( 36 IPaymentGatewayService, IPayer, IPayee, IPaymentItem, IPayment,36 IPaymentGatewayService, IPayer, IPayee, IPaymentItem, 37 37 ) 38 38 from waeup.ikoba.payments.paypal import ( … … 1142 1142 assert service.get_credit_card(u'CARD2') is None 1143 1143 1144 def DIStest_creditcard_service_can_create_payment(self):1145 # we can create IPayment objects with creditcard service1144 def test_create_payment_no_credictard(self): 1145 # trying to create a payment without credit card raises an exception 1146 1146 service = PayPalCreditCardService() 1147 payment = service.create_payment( 1148 payer=FakePayer(), 1149 payment_item=FakePaymentItem(), 1150 payee=FakePayee() 1151 ) 1152 assert IPayment.providedBy(payment) 1147 exception = None 1148 try: 1149 service.create_payment( 1150 payer=FakePayer(), 1151 payment_item=FakePaymentItem(), 1152 payee=FakePayee() 1153 ) 1154 except (ValueError, ) as err: 1155 exception = err 1156 assert exception.message == 'Payer PAYER-123 has no credit card.' 1153 1157 1154 1158
Note: See TracChangeset for help on using the changeset viewer.