- Timestamp:
- 21 Nov 2014, 08:07:15 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12016 r12018 107 107 # Set password 108 108 IUserAccount( 109 self.app['customers'][self.customer_id]).setPassword(' spwd')109 self.app['customers'][self.customer_id]).setPassword('cpwd') 110 110 111 111 self.login_path = 'http://localhost/app/login' … … 484 484 self.browser.open(self.login_path) 485 485 self.browser.getControl(name="form.login").value = self.customer_id 486 self.browser.getControl(name="form.password").value = ' spwd'486 self.browser.getControl(name="form.password").value = 'cpwd' 487 487 self.browser.getControl("Login").click() 488 488 self.assertMatches( … … 511 511 self.browser.open(self.login_path) 512 512 self.browser.getControl(name="form.login").value = self.customer_id 513 self.browser.getControl(name="form.password").value = ' spwd'513 self.browser.getControl(name="form.password").value = 'cpwd' 514 514 self.browser.getControl("Login").click() 515 515 self.assertEqual(self.browser.url, self.customer_path) … … 554 554 self.browser.open(self.login_path) 555 555 self.browser.getControl(name="form.login").value = self.customer_id 556 self.browser.getControl(name="form.password").value = ' spwd'556 self.browser.getControl(name="form.password").value = 'cpwd' 557 557 self.browser.getControl("Login").click() 558 558 self.assertMatches( … … 575 575 self.browser.open(self.login_path) 576 576 self.browser.getControl(name="form.login").value = self.customer_id 577 self.browser.getControl(name="form.password").value = ' spwd'577 self.browser.getControl(name="form.password").value = 'cpwd' 578 578 self.browser.getControl("Login").click() 579 579 self.assertEqual(self.browser.url, self.customer_path) … … 594 594 self.browser.open(self.login_path) 595 595 self.browser.getControl(name="form.login").value = self.customer_id 596 self.browser.getControl(name="form.password").value = ' spwd'596 self.browser.getControl(name="form.password").value = 'cpwd' 597 597 self.browser.getControl("Login").click() 598 598 self.assertTrue( … … 600 600 # We set the password again 601 601 IUserAccount( 602 self.app['customers'][self.customer_id]).setPassword(' spwd')602 self.app['customers'][self.customer_id]).setPassword('cpwd') 603 603 # Customers can't login if their account is suspended/deactivated 604 604 self.customer.suspended = True 605 605 self.browser.open(self.login_path) 606 606 self.browser.getControl(name="form.login").value = self.customer_id 607 self.browser.getControl(name="form.password").value = ' spwd'607 self.browser.getControl(name="form.password").value = 'cpwd' 608 608 self.browser.getControl("Login").click() 609 609 self.assertMatches( … … 613 613 self.customer.suspended_comment = u'Aetsch baetsch!' 614 614 self.browser.getControl(name="form.login").value = self.customer_id 615 self.browser.getControl(name="form.password").value = ' spwd'615 self.browser.getControl(name="form.password").value = 'cpwd' 616 616 self.browser.getControl("Login").click() 617 617 self.assertMatches( … … 622 622 # is not expired 623 623 self.app['customers'][self.customer_id].setTempPassword( 624 'anybody', 'temp_ spwd')625 self.browser.open(self.login_path) 626 self.browser.getControl(name="form.login").value = self.customer_id 627 self.browser.getControl(name="form.password").value = ' spwd'624 'anybody', 'temp_cpwd') 625 self.browser.open(self.login_path) 626 self.browser.getControl(name="form.login").value = self.customer_id 627 self.browser.getControl(name="form.password").value = 'cpwd' 628 628 self.browser.getControl("Login").click() 629 629 self.assertMatches( … … 633 633 self.browser.open(self.login_path) 634 634 self.browser.getControl(name="form.login").value = self.customer_id 635 self.browser.getControl(name="form.password").value = 'temp_ spwd'635 self.browser.getControl(name="form.password").value = 'temp_cpwd' 636 636 self.browser.getControl("Login").click() 637 637 self.assertMatches( … … 652 652 self.browser.open(self.login_path) 653 653 self.browser.getControl(name="form.login").value = self.customer_id 654 self.browser.getControl(name="form.password").value = ' spwd'654 self.browser.getControl(name="form.password").value = 'cpwd' 655 655 self.browser.getControl("Login").click() 656 656 self.assertMatches( … … 825 825 '- K1000000 - removed: %s' 826 826 % document.document_id in logcontent) 827 828 def test_edit_document(self): 829 # Customers can manage documents under certain conditions 830 self.browser.open(self.login_path) 831 self.browser.getControl(name="form.login").value = self.customer_id 832 self.browser.getControl(name="form.password").value = 'cpwd' 833 self.browser.getControl("Login").click() 834 self.assertMatches( 835 '...You logged in...', self.browser.contents) 836 self.browser.getLink("Documents").click() 837 self.browser.getLink("Add document").click() 838 self.browser.getControl(name="doctype").value = ['generic'] 839 self.browser.getControl("Create document").click() 840 self.assertTrue('Generic Document created.' in self.browser.contents) 841 document = self.customer['documents']['d102'] 842 843 # Document can be edited ... 844 self.browser.getLink("d102").click() 845 846 847 self.browser.open(self.documents_path + '/d102/edit') 848 #self.browser.getLink("Edit").click() 849 self.assertTrue('The requested form is locked' in self.browser.contents) 850 851 852 853 854 855 856 857 self.browser.getControl(name="form.title").value = 'My second doc' 858 self.browser.getControl("Save").click() 859 self.assertTrue('Form has been saved.' in self.browser.contents) 860 self.browser.getLink("View").click() 861 self.assertEqual(self.browser.url, self.documents_path + '/d102/index')
Note: See TracChangeset for help on using the changeset viewer.