Changeset 12015 for main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests
- Timestamp:
- 20 Nov 2014, 21:39:40 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r11997 r12015 1 ## $Id : test_browser.py 11862 2014-10-21 07:07:04Z henrik$1 ## $Id$ 2 2 ## 3 3 ## Copyright (C) 2014 Uli Fouquet & Henrik Bettermann … … 101 101 self.customer_id = customer.customer_id 102 102 self.customer = self.app['customers'][self.customer_id] 103 document = createObject('waeup.CustomerDocument') 104 document.title = u'My first document' 105 self.customer['documents'].addDocument(document) 103 106 104 107 # Set password … … 114 117 self.trigtrans_path = self.customer_path + '/trigtrans' 115 118 self.history_path = self.customer_path + '/history' 119 self.documents_path = self.customer_path + '/documents' 116 120 117 121 self.app['configuration'].carry_over = True … … 766 770 'job_id=%s' % job_id in logcontent 767 771 ) 772 773 774 class CustomerDocumentUITests(CustomersFullSetup): 775 # Tests for CustomerDocument relates views and pages 776 777 def test_manage_document(self): 778 # Managers can access the pages of customer documentsconter 779 # and can perform actions 780 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 781 self.browser.open(self.customer_path) 782 self.assertEqual(self.browser.headers['Status'], '200 Ok') 783 self.assertEqual(self.browser.url, self.customer_path) 784 self.browser.open(self.customer_path) 785 self.browser.getLink("Documents").click() 786 self.browser.getLink("Add document").click() 787 self.browser.getControl(name="doctype").value = ['generic'] 788 self.browser.getControl("Create document").click() 789 self.assertTrue('Generic Document created.' in self.browser.contents) 790 document = self.customer['documents']['d102'] 791 792 # Documents can be removed 793 ctrl = self.browser.getControl(name='val_id') 794 ctrl.getControl(value=document.document_id).selected = True 795 self.browser.getControl("Remove selected", index=0).click() 796 self.assertTrue('Successfully removed' in self.browser.contents) 797 798 # All actions are being logged 799 logfile = os.path.join( 800 self.app['datacenter'].storage, 'logs', 'customers.log') 801 logcontent = open(logfile).read() 802 803 self.assertTrue( 804 'INFO - zope.mgr - customers.browser.DocumentAddFormPage ' 805 '- K1000000 - added: Generic Document %s' 806 % document.document_id in logcontent) 807 808 self.assertTrue( 809 'INFO - zope.mgr - customers.browser.DocumentsManageFormPage ' 810 '- K1000000 - removed: %s' 811 % document.document_id in logcontent) -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_export.py
r12007 r12015 138 138 self.assertEqual( 139 139 result, 140 'doc type,document_id,history,title,customer_id\r\n'141 ' ,d101,[],,\r\n'140 'document_id,history,title,customer_id\r\n' 141 'd101,[],,\r\n' 142 142 ) 143 143 return … … 152 152 result = open(self.outfile, 'rb').read() 153 153 self.assertTrue( 154 'doc type,document_id,history,title,customer_id\r\n'154 'document_id,history,title,customer_id\r\n' 155 155 in result 156 156 ) … … 169 169 result = open(self.outfile, 'rb').read() 170 170 self.assertTrue( 171 'doc type,document_id,history,title,customer_id\r\n'171 'document_id,history,title,customer_id\r\n' 172 172 in result) 173 173 self.assertTrue( … … 184 184 result = open(self.outfile, 'rb').read() 185 185 self.assertTrue( 186 'doc type,document_id,history,title,customer_id\r\n'186 'document_id,history,title,customer_id\r\n' 187 187 in result) 188 188 self.assertTrue(
Note: See TracChangeset for help on using the changeset viewer.