- Timestamp:
- 5 Jan 2015, 07:45:40 (10 years ago)
- Location:
- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py
r12390 r12401 34 34 PCNCustomerPDFDocumentExporter, 35 35 PCNCustomerJPGDocumentExporter, 36 PCN ContractExporter)36 PCNLicenseContractExporter) 37 37 from ikobacustom.pcn.customers.batching import ( 38 38 PCNCustomerProcessor, 39 39 PCNCustomerPDFDocumentProcessor, 40 40 PCNCustomerJPGDocumentProcessor, 41 PCN ContractProcessor)41 PCNLicenseContractProcessor) 42 42 from ikobacustom.pcn.testing import FunctionalLayer, samples_dir 43 43 … … 68 68 customer['documents'].addDocument(document1) 69 69 customer['documents'].addDocument(document2) 70 contract = createObject(u'waeup.PCN Contract')70 contract = createObject(u'waeup.PCNLicenseContract') 71 71 contract.tc_dict = {'en':u'Hello World'} 72 72 customer['contracts'].addContract(contract) … … 210 210 # set values we can expect in export file 211 211 self.setup_for_export() 212 exporter = PCN ContractExporter()212 exporter = PCNLicenseContractExporter() 213 213 exporter.export_all(self.app, self.outfile) 214 214 result = open(self.outfile, 'rb').read() … … 217 217 'history,last_product_id,product_object,product_options,' 218 218 'state,tc_dict,title,user_id\r\n' 219 'PCN Contract,license,%s,,'219 'PCNLicenseContract,license,%s,,' 220 220 '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']' 221 221 ',,,[],created,{\'en\': u\'Hello World\'},,K1000000\r\n' 222 222 % self.contract.contract_id) 223 223 # We can reimport the file if we change the header (user_id -> customer_id) 224 processor = PCN ContractProcessor()224 processor = PCNLicenseContractProcessor() 225 225 open(self.outfile, 'wb').write( 226 226 'class_name,contract_category,contract_id,document_object,' 227 227 'history,last_product_id,product_object,product_options,' 228 228 'state,tc_dict,title,user_id\r\n' 229 'PCN Contract,license,%s,,'229 'PCNLicenseContract,license,%s,,' 230 230 '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']' 231 231 ',,,[],created,{\'en\': u\'Hello World\'},,K1000000\r\n' … … 270 270 self._contract_category = u'license' 271 271 self._document_factory = 'waeup.PCNCustomerPDFDocument' 272 self._contract_factory = 'waeup.PCN Contract'272 self._contract_factory = 'waeup.PCNLicenseContract' 273 273 return 274 274 … … 322 322 self._contract_category = u'license' 323 323 self._document_factory = 'waeup.PCNCustomerPDFDocument' 324 self._contract_factory = 'waeup.PCN Contract'324 self._contract_factory = 'waeup.PCNLicenseContract' 325 325 return 326 326 -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py
r12371 r12401 29 29 30 30 from ikobacustom.pcn.testing import (FunctionalLayer, FunctionalTestCase) 31 from ikobacustom.pcn.customers.contracts import PCN Contract32 from ikobacustom.pcn.customers.interfaces import IPCN Contract31 from ikobacustom.pcn.customers.contracts import PCNLicenseContract 32 from ikobacustom.pcn.customers.interfaces import IPCNLicenseContract 33 33 34 34 … … 38 38 39 39 def test_interfaces(self): 40 verify.verifyClass(IPCN Contract, PCNContract)41 verify.verifyClass(ICustomerNavigation, PCN Contract)42 verify.verifyObject(IPCN Contract, PCNContract())43 verify.verifyObject(ICustomerNavigation, PCN Contract())40 verify.verifyClass(IPCNLicenseContract, PCNLicenseContract) 41 verify.verifyClass(ICustomerNavigation, PCNLicenseContract) 42 verify.verifyObject(IPCNLicenseContract, PCNLicenseContract()) 43 verify.verifyObject(ICustomerNavigation, PCNLicenseContract()) 44 44 return 45 45 46 46 def test_addContract(self): 47 47 container = ContractsContainer() 48 contract = createObject(u'waeup.PCN Contract')48 contract = createObject(u'waeup.PCNLicenseContract') 49 49 id = contract.contract_id 50 50 container.addContract(contract) 51 51 self.assertEqual(container[id], contract) 52 52 self.assertRaises(TypeError, container.addContract, object()) 53 self.assertEqual(contract.class_name, 'PCN Contract')53 self.assertEqual(contract.class_name, 'PCNLicenseContract') 54 54 return
Note: See TracChangeset for help on using the changeset viewer.