Ignore:
Timestamp:
24 Dec 2014, 09:17:05 (10 years ago)
Author:
uli
Message:

Merge changes from uli-paypal back into trunk.

Location:
main/waeup.ikoba/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk

  • main/waeup.ikoba/trunk/src/waeup/ikoba

  • main/waeup.ikoba/trunk/src/waeup/ikoba/payments/tests/test_interfaces.py

    r12060 r12311  
    1717##
    1818"""
    19 Tests for payments.
     19Tests for payments interfaces.
    2020"""
    21 from zope.interface.verify import verifyClass, verifyObject
    22 from waeup.ikoba.payments.interfaces import (
    23     IPaymentsContainer, IOnlinePayment)
    24 from waeup.ikoba.payments.container import PaymentsContainer
    25 from waeup.ikoba.payments.payment import OnlinePayment
     21from waeup.ikoba.payments.interfaces import PaymentGatewayServicesSource
    2622from waeup.ikoba.testing import (FunctionalLayer, FunctionalTestCase)
    2723
     
    3127    layer = FunctionalLayer
    3228
    33     def test_interfaces(self):
    34         # Make sure the correct interfaces are implemented.
    35         self.assertTrue(
    36             verifyClass(
    37                 IPaymentsContainer, PaymentsContainer)
    38             )
    39         self.assertTrue(
    40             verifyObject(
    41                 IPaymentsContainer, PaymentsContainer())
    42             )
    43         self.assertTrue(
    44             verifyClass(
    45                 IOnlinePayment, OnlinePayment)
    46             )
    47         self.assertTrue(
    48             verifyObject(
    49                 IOnlinePayment, OnlinePayment())
    50             )
    51         return
     29    def test_payment_gateway_services_source(self):
     30        # the payment gateway services source provides a list of registered
     31        # payment gateways
     32        source = PaymentGatewayServicesSource()
     33        services = list(source)
     34        assert len(services) > 0
    5235
    53     def test_base(self):
    54         # We cannot call the fundamental methods of a base in that case
    55         container = PaymentsContainer()
    56         self.assertRaises(
    57             NotImplementedError, container.archive)
    58         self.assertRaises(
    59             NotImplementedError, container.clear)
     36    def test_payment_gateway_services_source_title(self):
     37        # we can get titles from gateway sources
     38        source = PaymentGatewayServicesSource()
     39        service1 = list(source)[0]
     40        title = source.factory.getTitle(service1)
     41        assert title != service1
     42        assert isinstance(title, basestring)
Note: See TracChangeset for help on using the changeset viewer.