Changeset 12532 for main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Timestamp:
- 1 Feb 2015, 06:06:11 (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
r12531 r12532 36 36 from waeup.ikoba.interfaces import MessageFactory as _ 37 37 from waeup.ikoba.interfaces import ( 38 IContactForm, IObjectHistory, IIkobaObject, IIkobaUtils, 38 IContactForm, IObjectHistory, IIkobaObject, IIkobaUtils, IExtFileStore, 39 39 IPasswordValidator, IUserAccount, 40 40 STARTED, VERIFIED, REJECTED, EXPIRED, CREATED, REQUESTED, … … 737 737 """To be implemented in the customization package. 738 738 """ 739 store = getUtility(IExtFileStore) 740 error = '' 741 if not store.getFileByContext(self.context, attr=u'passport.jpg'): 742 error += _('Passport picture is missing.') 743 if error: 744 return error 739 745 return 740 746 -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12527 r12532 611 611 return 612 612 613 def test_customer_ upload_passport(self):613 def test_customer_edit_upload_upload_and_request(self): 614 614 # Customer cant login if their password is not set 615 615 self.browser.open(self.login_path) … … 619 619 self.assertMatches( 620 620 '...You logged in...', self.browser.contents) 621 # Admitted customer can upload a passport picture 621 self.browser.getLink("Edit").click() 622 self.browser.getControl(name="form.email").value = 'new_email@aa.ng' 623 self.browser.getControl("Save", index=1).click() 624 self.assertMatches('...Form has been saved...', 625 self.browser.contents) 626 self.browser.getControl("Save and request registration").click() 627 self.assertMatches('...Passport picture is missing...', 628 self.browser.contents) 629 self.assertEqual(self.customer.state, 'started') 630 # Customer must upload a passport picture 631 self.browser.open(self.customer_path) 622 632 self.browser.getLink("Upload files").click() 623 633 ctrl = self.browser.getControl(name='passporteditupload') … … 632 642 self.browser.getControl(name="CANCEL").click() 633 643 self.assertEqual(self.browser.url, self.customer_path) 634 635 def test_customer_baseedit(self):636 # Customers can change the password637 self.customer.personal_updated = datetime.utcnow()638 self.browser.open(self.login_path)639 self.browser.getControl(name="form.login").value = self.customer_id640 self.browser.getControl(name="form.password").value = 'cpwd'641 self.browser.getControl("Login").click()642 self.assertEqual(self.browser.url, self.customer_path)643 self.assertTrue('You logged in' in self.browser.contents)644 644 self.browser.getLink("Edit").click() 645 self.browser.getControl(name="form.email").value = 'new_email@aa.ng' 646 self.browser.getControl("Save", index=1).click() 647 self.assertMatches('...Form has been saved...', 645 self.browser.getControl("Save and request registration").click() 646 self.assertMatches('...Registration form has been submitted...', 648 647 self.browser.contents) 648 self.assertEqual(self.customer.state, 'requested') 649 649 # Customer can view history 650 650 self.browser.getLink("History").click()
Note: See TracChangeset for help on using the changeset viewer.