Ignore:
Timestamp:
12 Jan 2015, 15:19:54 (10 years ago)
Author:
uli
Message:

Store credit card data really and externally.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/payments/tests/test_paypal.py

    r12453 r12454  
    11561156        assert service.get_credit_card(u'CARD2') is None
    11571157
    1158     def test_store_credit_card_no_credcard_container(self):
    1159         # a missing creditcards container is created on-the-fly
     1158    @external_paypal_test
     1159    def test_store_credit_card(self):
     1160        # we can (and must) store credit card data online.
    11601161        site = self.create_site()
    11611162        assert 'creditcards' not in site
    11621163        service = PayPalCreditCardService()
    11631164        credit_card = self.get_credit_card()
    1164         service.store_credit_card(credit_card)
     1165        result = service.store_credit_card(credit_card)
     1166        # a missing creditcards container is created on-the-fly
    11651167        assert 'creditcards' in site
     1168        assert ICreditCardToken.providedBy(result)
     1169        assert result.payer_id in site['creditcards']
     1170        assert site['creditcards'][result.payer_id] == result
     1171
     1172    @external_paypal_test
     1173    def test_store_credit_card_invalid(self):
     1174        # an exception is raised with invalid credit cards.
     1175        site = self.create_site()
     1176        service = PayPalCreditCardService()
     1177        credit_card = CreditCard(
     1178            number=u"12345678",
     1179            credit_card_type="visa",
     1180            expire_month=4,
     1181            expire_year=2012,
     1182            )
     1183        self.assertRaises(
     1184            IOError, service.store_credit_card, credit_card)
    11661185
    11671186    def test_create_payment_no_credictard(self):
Note: See TracChangeset for help on using the changeset viewer.