Changeset 12517
- Timestamp:
- 27 Jan 2015, 11:42:21 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12500 r12517 38 38 IContactForm, IObjectHistory, IIkobaObject, IIkobaUtils, 39 39 IPasswordValidator, IUserAccount, 40 VERIFIED, REJECTED, EXPIRED, REQUESTED, APPROVED)40 VERIFIED, REJECTED, EXPIRED, CREATED, REQUESTED, APPROVED) 41 41 from waeup.ikoba.browser.layout import ( 42 42 IkobaPage, IkobaEditFormPage, IkobaAddFormPage, IkobaDisplayFormPage, … … 326 326 return True 327 327 328 def update(self): 329 # Fire transition if customer logs in for the first time 330 usertype = getattr(self.request.principal, 'user_type', None) 331 if usertype == 'customer' and \ 332 IWorkflowState(self.context).getState() == CREATED: 333 IWorkflowInfo(self.context).fireTransition('start') 334 return 335 328 336 329 337 class ContactCustomerForm(ContactAdminForm): -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12500 r12517 500 500 prmglobal.assignRoleToPrincipal('waeup.CustomerImpersonator', 'mrofficer') 501 501 prmglobal.assignRoleToPrincipal('waeup.CustomersManager', 'mrofficer') 502 self.assertEqual(self.customer.state, 'created') 502 503 # Login as customer impersonator 503 504 self.browser.open(self.login_path) … … 513 514 self.assertMatches( 514 515 '...You successfully logged in as...', self.browser.contents) 516 # Status has changed 517 self.assertEqual(self.customer.state, 'started') 515 518 # We are logged in as customer and can see the 'My Data' tab 516 519 self.assertMatches( … … 549 552 def test_customer_change_password(self): 550 553 # Customers can change the password 554 self.assertEqual(self.customer.state, 'created') 551 555 self.customer.personal_updated = datetime.utcnow() 552 556 self.browser.open(self.login_path) … … 556 560 self.assertEqual(self.browser.url, self.customer_path) 557 561 self.assertTrue('You logged in' in self.browser.contents) 562 # Status has changed 563 self.assertEqual(self.customer.state, 'started') 558 564 # Change password 559 565 self.browser.getLink("Change password").click() … … 592 598 def test_customer_upload_passport(self): 593 599 # Customer cant login if their password is not set 594 IWorkflowInfo(self.customer).fireTransition('start')595 600 self.browser.open(self.login_path) 596 601 self.browser.getControl(name="form.login").value = self.customer_id
Note: See TracChangeset for help on using the changeset viewer.