Changeset 12221 for main/waeup.ikoba/trunk
- Timestamp:
- 14 Dec 2014, 06:14:39 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12220 r12221 229 229 self.applyData(customer, **data) 230 230 self.context.addCustomer(customer) 231 self.flash(_('Customer recordcreated.'))231 self.flash(_('Customer created.')) 232 232 self.redirect(self.url(self.context[customer.customer_id], 'index')) 233 233 return … … 525 525 # know that a record was found and only the firstname 526 526 # verification failed. 527 self.flash(_('No customer recordfound.'), type="warning")527 self.flash(_('No customer found.'), type="warning") 528 528 return 529 529 elif customer.password is not None and self._pw_used: … … 537 537 else: 538 538 # No record found, this is the truth. 539 self.flash(_('No customer recordfound.'), type="warning")539 self.flash(_('No customer found.'), type="warning") 540 540 return 541 541 -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12216 r12221 140 140 self.contracts_path = self.customer_path + '/contracts' 141 141 142 self.app['configuration'].carry_over = True143 144 142 # Update the catalog 145 143 notify(grok.ObjectModifiedEvent(self.customer)) … … 195 193 in self.browser.contents) 196 194 self.browser.getControl(name="form.reg_number").value = '1234' 197 self.browser.getControl("Create customer record").click()198 self.assertTrue('Customer recordcreated' in self.browser.contents)195 self.browser.getControl("Create customer").click() 196 self.assertTrue('Customer created' in self.browser.contents) 199 197 200 198 # Registration must be unique … … 604 602 # Customer can view history 605 603 self.browser.getLink("History").click() 606 self.assertMatches('...Customer recordcreated by system...',604 self.assertMatches('...Customer created by system...', 607 605 self.browser.contents) 608 606 … … 694 692 self.browser.getControl(name="form.email").value = 'xx@yy.zz' 695 693 self.browser.getControl("Send login credentials").click() 696 self.assertTrue('No customer recordfound.'694 self.assertTrue('No customer found.' 697 695 in self.browser.contents) 698 696 # Anonymous is not informed that firstname verification failed. … … 703 701 self.browser.getControl(name="form.email").value = 'xx@yy.zz' 704 702 self.browser.getControl("Send login credentials").click() 705 self.assertTrue('No customer recordfound.'703 self.assertTrue('No customer found.' 706 704 in self.browser.contents) 707 705 # Even with the correct firstname we can't register if a … … 815 813 816 814 class DocumentUITests(CustomersFullSetup): 817 # Tests for CustomerSampleDocument relatesviews and pages815 # Tests for customer document related views and pages 818 816 819 817 def test_manage_document(self): … … 877 875 878 876 self.assertTrue( 877 'INFO - system - K1000000 - d101 - Document created' 878 in logcontent) 879 self.assertTrue( 880 'INFO - zope.mgr - customers.browser.DocumentAddFormPage ' 881 '- K1000000 - added: PDF Document %s' 882 % document.document_id in logcontent) 883 self.assertTrue( 879 884 'INFO - zope.mgr - customers.browser.DocumentManageFormPage ' 880 885 '- K1000000 - d102 - saved: title' 881 886 in logcontent) 882 887 self.assertTrue( 883 'INFO - zope.mgr - customers.browser.DocumentAddFormPage ' 884 '- K1000000 - added: PDF Document %s' 885 % document.document_id in logcontent) 888 'INFO - zope.mgr - K1000000 - d102 - Submitted for verification' 889 in logcontent) 886 890 self.assertTrue( 887 891 'INFO - zope.mgr - customers.browser.DocumentsManageFormPage ' 888 '- K1000000 - removed: %s'889 % document.document_idin logcontent)892 '- K1000000 - removed: d102' 893 in logcontent) 890 894 891 895 def test_edit_sample_document(self): … … 1128 1132 1129 1133 class ContractUITests(CustomersFullSetup): 1130 # Tests for CustomerSampleContract relatesviews and pages1134 # Tests for contract related views and pages 1131 1135 1132 1136 def test_manage_contract(self): … … 1176 1180 logcontent = open(logfile).read() 1177 1181 self.assertTrue( 1182 'INFO - zope.mgr - K1000000 - c102 - Contract created' 1183 in logcontent) 1184 self.assertTrue( 1185 'INFO - zope.mgr - customers.browser.ContractAddFormPage ' 1186 '- K1000000 - added: Sample Contract %s' 1187 % contract.contract_id in logcontent) 1188 self.assertTrue( 1178 1189 'INFO - zope.mgr - customers.browser.ContractManageFormPage ' 1179 1190 '- K1000000 - c102 - saved: title' 1180 1191 in logcontent) 1181 1192 self.assertTrue( 1182 'INFO - zope.mgr - customers.browser.ContractAddFormPage ' 1183 '- K1000000 - added: Sample Contract %s' 1184 % contract.contract_id in logcontent) 1193 'INFO - zope.mgr - K1000000 - c102 - Submitted for approval' 1194 in logcontent) 1195 self.assertTrue( 1196 'INFO - zope.mgr - K1000000 - c102 - Approved' 1197 in logcontent) 1185 1198 self.assertTrue( 1186 1199 'INFO - zope.mgr - customers.browser.ContractsManageFormPage ' 1187 '- K1000000 - removed: %s'1188 % contract.contract_idin logcontent)1200 '- K1000000 - removed: c102' 1201 in logcontent) 1189 1202 1190 1203 def test_edit_sample_contract(self): -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_contract.py
r12196 r12221 88 88 IWorkflowInfo(doc).fireTransition('create') 89 89 messages = ' '.join(doc.history.messages) 90 self.assertTrue('Contract recordcreated by system' in messages)90 self.assertTrue('Contract created by system' in messages) 91 91 return -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_export.py
r12210 r12221 94 94 'sex,suspended,suspended_comment,password,state,history\r\n' 95 95 'A111111,anna@sample.com,Anna,Tester,M.,+234-123-12345#,123,,0,,,' 96 'created,[u\'2014-12-04 11:25:35 UTC - Customer recordcreated '96 'created,[u\'2014-12-04 11:25:35 UTC - Customer created ' 97 97 'by system\']\r\n', 98 98 result … … 274 274 275 275 'SampleContract,sample,c101,d101,[u\'2014-12-04 12:10:46 UTC - ' 276 'Contract recordcreated by system\'],,'276 'Contract created by system\'],,' 277 277 'SAM,created,My Contract\r\n', 278 278 result … … 293 293 294 294 'SampleContract,sample,c101,d101,[u\'2014-12-04 12:10:46 UTC - ' 295 'Contract recordcreated by system\'],,'295 'Contract created by system\'],,' 296 296 'SAM,created,My Contract\r\n', 297 297 result … … 312 312 313 313 'SampleContract,sample,c101,d101,[u\'2014-12-04 12:10:46 UTC - ' 314 'Contract recordcreated by system\'],,'314 'Contract created by system\'],,' 315 315 'SAM,created,My Contract\r\n', 316 316 result -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/workflow.py
r12213 r12221 46 46 source = None, 47 47 condition = NullCondition, 48 msg = _('Customer recordcreated'),48 msg = _('Customer created'), 49 49 destination = CREATED), 50 50 … … 150 150 Transition( 151 151 transition_id = 'create', 152 title = _('Create contract record'),152 title = _('Create contract'), 153 153 source = None, 154 154 condition = NullCondition, 155 msg = _('Contract recordcreated'),155 msg = _('Contract created'), 156 156 destination = CREATED), 157 157 … … 254 254 try: 255 255 customers_container = grok.getSite()['customers'] 256 customers_container.logger.info('%s - %s' % (obj.customer_id,msg)) 256 customers_container.logger.info( 257 '%s - %s - %s' % (obj.customer.customer_id, obj.contract_id, msg)) 257 258 except (TypeError, AttributeError): 258 259 pass … … 370 371 try: 371 372 customers_container = grok.getSite()['customers'] 372 customers_container.logger.info('%s - %s' % (obj.customer_id,msg)) 373 customers_container.logger.info( 374 '%s - %s - %s' % (obj.customer.customer_id, obj.document_id, msg)) 373 375 except (TypeError, AttributeError): 374 376 pass
Note: See TracChangeset for help on using the changeset viewer.