Changeset 12363 for main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests
- Timestamp:
- 2 Jan 2015, 07:50:34 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_batching.py
r12358 r12363 150 150 contract.document_object = self.document 151 151 contract.product_options = self.product.options 152 contract.tc_dict = {'en': u'Hello world'} 152 153 customer['contracts'].addContract(contract) 153 154 self.contract = contract -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12358 r12363 107 107 self.product.contract_category = u'sample' 108 108 self.product.valid_from = date(2015, 12, 4) 109 self.product.tc_dict = {'en': u'Hello world'} 109 110 prodoption = ProductOption() 110 111 prodoption.title = u'First option' … … 1179 1180 conid = [i for i in self.customer['contracts'].keys() if len(i) > 10][0] 1180 1181 contract = self.customer['contracts'][conid] 1181 1182 # Contract can be edited 1183 self.browser.getLink(conid[:6]).click() 1184 self.browser.getLink("Manage").click() 1182 self.assertEqual( 1183 self.browser.url, self.contracts_path + '/%s/selectproduct' % conid) 1184 # SAM is in the correct contract_category ... 1185 self.assertTrue('<option value="SAM">' in self.browser.contents) 1186 # ... but NOTSAM not. 1187 self.assertFalse('<option value="LIC">' in self.browser.contents) 1188 # So far last_product_id is None. 1189 self.assertTrue(self.customer['contracts'][conid].last_product_id is None) 1185 1190 self.browser.getControl(name="form.product_object").value = ['SAM'] 1186 self.browser.getControl("Save").click() 1187 self.assertTrue('Form has been saved.' in self.browser.contents) 1191 self.browser.getControl("Save and proceed").click() 1192 self.assertEqual( 1193 self.browser.url, self.contracts_path + '/%s/manage' % conid) 1188 1194 self.browser.getLink("View").click() 1189 1195 self.assertEqual(self.browser.url, self.contracts_path + '/%s/index' % conid) 1196 self.assertEqual(contract.tc_dict, {'en': u'Hello world'}) 1190 1197 1191 1198 # Transitions can be performed -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_export.py
r12342 r12363 257 257 'class_name,contract_category,contract_id,document_object,' 258 258 'history,last_product_id,' 259 'product_object,product_options,state,t itle,user_id\r\n'260 261 'SampleContract,sample,CON1,,[],,,[],, ,\r\n'259 'product_object,product_options,state,tc_dict,title,user_id\r\n' 260 261 'SampleContract,sample,CON1,,[],,,[],,{},,\r\n' 262 262 ) 263 263 return … … 273 273 'class_name,contract_category,contract_id,document_object,' 274 274 'history,last_product_id,' 275 'product_object,product_options,state,t itle,user_id\r\n'275 'product_object,product_options,state,tc_dict,title,user_id\r\n' 276 276 277 277 'SampleContract,sample,CON1,DOC1,[u\'2014-12-04 12:10:46 UTC - ' 278 278 'Contract created by system\'],,' 279 279 'SAM,"[(u\'Base Fee\', u\'800.6\', u\'USD\')]",' 280 'created, Our Sample Product,A111111\r\n',280 'created,{\'en\': u\'Hello world\'},Our Sample Product,A111111\r\n', 281 281 result 282 282 ) … … 293 293 'class_name,contract_category,contract_id,document_object,' 294 294 'history,last_product_id,' 295 'product_object,product_options,state,t itle,user_id\r\n'295 'product_object,product_options,state,tc_dict,title,user_id\r\n' 296 296 297 297 'SampleContract,sample,CON1,DOC1,[u\'2014-12-04 12:10:46 UTC - ' 298 298 'Contract created by system\'],,' 299 299 'SAM,"[(u\'Base Fee\', u\'800.6\', u\'USD\')]",' 300 'created, Our Sample Product,A111111\r\n',300 'created,{\'en\': u\'Hello world\'},Our Sample Product,A111111\r\n', 301 301 result 302 302 ) … … 313 313 'class_name,contract_category,contract_id,document_object,' 314 314 'history,last_product_id,' 315 'product_object,product_options,state,t itle,user_id\r\n'315 'product_object,product_options,state,tc_dict,title,user_id\r\n' 316 316 317 317 'SampleContract,sample,CON1,DOC1,[u\'2014-12-04 12:10:46 UTC - ' 318 318 'Contract created by system\'],,' 319 319 'SAM,"[(u\'Base Fee\', u\'800.6\', u\'USD\')]",' 320 'created, Our Sample Product,A111111\r\n',321 result 322 ) 323 return 324 320 'created,{\'en\': u\'Hello world\'},Our Sample Product,A111111\r\n', 321 result 322 ) 323 return 324
Note: See TracChangeset for help on using the changeset viewer.