Changeset 12697 for main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/customers/tests/test_contract.py
- Timestamp:
- 9 Mar 2015, 01:51:12 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/customers/tests/test_contract.py
r12683 r12697 28 28 from waeup.ikoba.customers.contracts import ( 29 29 ContractsContainer, SampleContract, payment_items_from_contract, 30 ContractPayer, 30 31 ) 31 from waeup.ikoba.payments.interfaces import IPaymentItem 32 from waeup.ikoba.customers.customer import Customer 33 from waeup.ikoba.payments.interfaces import IPaymentItem, IPayer 32 34 from waeup.ikoba.products.productoptions import ProductOption 33 35 from waeup.ikoba.testing import (FunctionalLayer, FunctionalTestCase) … … 122 124 payment_items = payment_items_from_contract(contract) 123 125 assert payment_items == [] 126 127 def test_payer_adapter(self): 128 # we can adapt IContract to IPayer (i.e. create a payer) 129 customer = Customer() 130 customer.firstname, customer.lastname = u'Anna', u'Tester' 131 contract = createObject(u'waeup.SampleContract') 132 customer['contracts'] = ContractsContainer() 133 customer['contracts'].addContract(contract) 134 result = IPayer(contract) 135 self.assertTrue(isinstance(result, ContractPayer)) 136 verifyObject(IPayer, result) 137 self.assertEqual(result.first_name, u'Anna') 138 self.assertEqual(result.last_name, u'Tester') 139 self.assertEqual(result.payer_id, customer.customer_id)
Note: See TracChangeset for help on using the changeset viewer.