Ignore:
Timestamp:
2 Mar 2015, 00:46:09 (10 years ago)
Author:
uli
Message:

Consider changed Payment interface.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/branches/uli-fake-gw-provider/src/waeup/ikoba/payments/tests/test_demo_provider.py

    r12642 r12647  
    2727        service = DemoCreditcardPaymentService()
    2828        payer, payment_item, payee = Payer(), PaymentItem(), Payee()
    29         payment_item.item_id = u'SOME_ITEM_ID'
    3029        payer.payer_id = u'SOME_PAYER_ID'
    31         result = service.create_payment(payer, payment_item, payee)
     30        result = service.create_payment(payer, [], payee)
    3231        assert IPayment.providedBy(result)
    3332        assert result.gateway_service == u'demo'
    3433        assert result.state == STATE_UNPAID
     34        assert len(result) == 0  # no items stored
    3535
    3636    def test_create_payment_honors_payment_item(self):
     
    4141        payer.payer_id = u'SOME_PAYER_ID'
    4242        payment_item.amount = decimal.Decimal("300.99")
    43         result = service.create_payment(payer, payment_item, payee)
    44         assert result.payed_item_id == payment_item.item_id
    45         assert result.amount == payment_item.amount
     43        result = service.create_payment(payer, [payment_item], payee)
     44        self.assertEqual(result.amount, payment_item.amount)
     45        assert len(result) == 1
    4646
    4747    def test_create_payment_honors_payer(self):
     
    5151        payment_item.item_id = u'SOME_ITEM_ID'
    5252        payer.payer_id = u'SOME_PAYER_ID'
    53         result = service.create_payment(payer, payment_item, payee)
     53        result = service.create_payment(payer, [payment_item], payee)
    5454        assert result.payer_id == payer.payer_id
Note: See TracChangeset for help on using the changeset viewer.