- Timestamp:
- 23 Sep 2016, 16:38:53 (8 years ago)
- Location:
- main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests/test_browser.py
r14181 r14184 33 33 UnibenCustomerExporter, 34 34 UnibenCustomerDocumentExporter, 35 UnibenContractExporter)35 RIAAContractExporter) 36 36 from ikobacustom.uniben.customers.batching import ( 37 37 UnibenCustomerProcessor, 38 38 UnibenCustomerDocumentProcessor, 39 UnibenContractProcessor)39 RIAAContractProcessor) 40 40 from ikobacustom.uniben.testing import FunctionalLayer, samples_dir 41 41 … … 49 49 50 50 def setup_customizable_params(self): 51 self._contract_category = u' sample'51 self._contract_category = u'riaa' 52 52 return 53 53 … … 64 64 document.title = u'My first document' 65 65 customer['documents'].addDocument(document) 66 contract = createObject(u'waeup. UnibenContract')66 contract = createObject(u'waeup.RIAAContract') 67 67 contract.tc_dict = {'en':u'Hello World'} 68 68 customer['contracts'].addContract(contract) … … 162 162 # set values we can expect in export file 163 163 self.setup_for_export() 164 exporter = UnibenContractExporter()164 exporter = RIAAContractExporter() 165 165 exporter.export_all(self.app, self.outfile) 166 166 result = open(self.outfile, 'rb').read() … … 169 169 'fee_based,history,last_product_id,product_object,product_options,' 170 170 'state,tc_dict,title,user_id,valid_from,valid_to\r\n' 171 ' UnibenContract,,sample,%s,,0,'171 'RIAAContract,,riaa,%s,,0,' 172 172 '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']' 173 173 ',,,[],created,{\'en\': u\'Hello World\'},,K1000000,,\r\n' 174 174 % self.contract.contract_id) 175 175 # We can reimport the file if we change the header (user_id -> customer_id) 176 processor = UnibenContractProcessor()176 processor = RIAAContractProcessor() 177 177 open(self.outfile, 'wb').write( 178 178 'class_name,contract_category,contract_id,document_object,' 179 179 'history,last_product_id,product_object,product_options,' 180 180 'state,tc_dict,title,user_id\r\n' 181 ' UnibenContract,sample,%s,,'181 'RIAAContract,riaa,%s,,' 182 182 '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']' 183 183 ',,,[],created,{\'en\': u\'Hello World\'},,K1000000\r\n' … … 220 220 221 221 def setup_customizable_params(self): 222 self._contract_category = u' sample'222 self._contract_category = u'riaa' 223 223 self._document_factory = 'waeup.UnibenCustomerDocument' 224 self._contract_factory = 'waeup. UnibenContract'224 self._contract_factory = 'waeup.RIAAContract' 225 225 return 226 226 … … 303 303 304 304 def setup_customizable_params(self): 305 self._contract_category = u' sample'305 self._contract_category = u'riaa' 306 306 self._document_factory = 'waeup.UnibenCustomerDocument' 307 self._contract_factory = 'waeup. UnibenContract'307 self._contract_factory = 'waeup.RIAAContract' 308 308 return 309 309 -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests/test_contract.py
r14181 r14184 29 29 30 30 from ikobacustom.uniben.testing import (FunctionalLayer, FunctionalTestCase) 31 from ikobacustom.uniben.customers.contracts import UnibenContract32 from ikobacustom.uniben.customers.interfaces import I UnibenContract31 from ikobacustom.uniben.customers.contracts import RIAAContract 32 from ikobacustom.uniben.customers.interfaces import IRIAAContract 33 33 34 34 … … 38 38 39 39 def test_interfaces(self): 40 verify.verifyClass(I UnibenContract, UnibenContract)41 verify.verifyClass(ICustomerNavigation, UnibenContract)42 verify.verifyObject(I UnibenContract, UnibenContract())43 verify.verifyObject(ICustomerNavigation, UnibenContract())40 verify.verifyClass(IRIAAContract, RIAAContract) 41 verify.verifyClass(ICustomerNavigation, RIAAContract) 42 verify.verifyObject(IRIAAContract, RIAAContract()) 43 verify.verifyObject(ICustomerNavigation, RIAAContract()) 44 44 return 45 45 46 46 def test_addContract(self): 47 47 container = ContractsContainer() 48 contract = createObject(u'waeup. UnibenContract')48 contract = createObject(u'waeup.RIAAContract') 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, ' UnibenContract')53 self.assertEqual(contract.class_name, 'RIAAContract') 54 54 return
Note: See TracChangeset for help on using the changeset viewer.