- Timestamp:
- 29 Dec 2014, 06:52:30 (10 years ago)
- Location:
- main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/customers/contracts.py
r12286 r12335 28 28 from ikobacustom.skeleton.interfaces import MessageFactory as _ 29 29 from ikobacustom.skeleton.customers.interfaces import ( 30 ISkeletonContract, ISkeletonContractEdit )30 ISkeletonContract, ISkeletonContractEdit, ISkeletonContractProcess) 31 31 32 32 … … 36 36 37 37 grok.implements( 38 ISkeletonContract, ISkeletonContractEdit, ICustomerNavigation) 38 ISkeletonContractProcess, 39 ISkeletonContract, 40 ISkeletonContractEdit, 41 ICustomerNavigation) 39 42 40 43 contract_category = 'sample' -
main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/customers/interfaces.py
r12292 r12335 22 22 from waeup.ikoba.customers.vocabularies import ( 23 23 ConCatProductSource, CustomerDocumentSource) 24 from waeup.ikoba.products.productoptions import ProductOptionField 24 25 from ikobacustom.skeleton.interfaces import MessageFactory as _ 25 26 … … 51 52 ) 52 53 54 class ISkeletonContractProcess(ISkeletonContract): 55 """Interface for processing contract data. 56 """ 57 58 product_options = schema.List( 59 title = _(u'Options/Fees'), 60 value_type = ProductOptionField(), 61 required = False, 62 readonly = False, 63 default = [], 64 ) 65 53 66 class ISkeletonContractEdit(ISkeletonContract): 54 67 """Interface for editing sample contract data by customers. -
main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/customers/tests/test_browser.py
r12292 r12335 157 157 self.assertMatches(result, 158 158 'class_name,contract_category,contract_id,document_object,' 159 'history,last_product_id,product_object,state,title,user_id\r\n' 159 'history,last_product_id,product_object,product_options,' 160 'state,title,user_id\r\n' 160 161 'SkeletonContract,sample,%s,,' 161 162 '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']' 162 ',,, created,My first contract,K1000000\r\n'163 ',,,[],created,My first contract,K1000000\r\n' 163 164 % self.contract.contract_id) 164 165 # We can reimport the file if we change the header (user_id -> customer_id) … … 166 167 open(self.outfile, 'wb').write( 167 168 'class_name,contract_category,contract_id,document_object,' 168 'history,last_product_id,product_object,state,title,customer_id\r\n' 169 'history,last_product_id,product_object,product_options,' 170 'state,title,user_id\r\n' 169 171 'SkeletonContract,sample,%s,,' 170 172 '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']' 171 ',,, created,My first contract,K1000000\r\n'173 ',,,[],created,My first contract,K1000000\r\n' 172 174 % self.contract.contract_id) 173 175 result = processor.doImport( 174 176 self.outfile, 175 177 ['class_name','contract_category','contract_id','document_object', 176 'history','last_product_id','product_object','state','title','customer_id'], 178 'history','last_product_id','product_object','product_options', 179 'state','title','customer_id'], 177 180 mode='create') 178 181 num, num_fail, finished_path, failed_path = result … … 184 187 self.outfile, 185 188 ['class_name','contract_category','contract_id','document_object', 186 'history','last_product_id','product_object','state','title','customer_id'], 189 'history','last_product_id','product_object','product_options', 190 'state','title','customer_id'], 187 191 mode='create') 188 192 num_succ, num_fail, finished_path, failed_path = result … … 192 196 self.outfile, 193 197 ['class_name','contract_category','contract_id','document_object', 194 'history','last_product_id','product_object','state','title','customer_id'], 198 'history','last_product_id','product_object','product_options', 199 'state','title','customer_id'], 195 200 mode='update') 196 201 num_succ, num_fail, finished_path, failed_path = result -
main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/products/tests/test_browser.py
r12269 r12335 52 52 result = open(self.outfile, 'rb').read() 53 53 self.assertEqual(result, 54 'contract_category, product_id,title,users_with_local_roles\r\n'55 'license, LIC,Unnamed,[]\r\n')54 'contract_category,options,product_id,title,users_with_local_roles\r\n' 55 'license,[],LIC,Unnamed,[]\r\n') 56 56 # We can import the same file. 57 57 processor = SkeletonProductProcessor() 58 58 result = processor.doImport( 59 59 self.outfile, 60 ['contract_category','product_id','title','users_with_local_roles'], 60 ['contract_category','options,', 'product_id','title', 61 'users_with_local_roles'], 61 62 mode='create') 62 63 num, num_fail, finished_path, failed_path = result … … 68 69 result = processor.doImport( 69 70 self.outfile, 70 ['contract_category','product_id','title','users_with_local_roles'], 71 ['contract_category','options','product_id','title', 72 'users_with_local_roles'], 71 73 mode='create') 72 74 num, num_fail, finished_path, failed_path = result … … 76 78 result = processor.doImport( 77 79 self.outfile, 78 ['contract_category','product_id','title','users_with_local_roles'], 80 ['contract_category','options','product_id','title', 81 'users_with_local_roles'], 79 82 mode='update') 80 83 num, num_fail, finished_path, failed_path = result
Note: See TracChangeset for help on using the changeset viewer.