Changeset 12240 for main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests
- Timestamp:
- 15 Dec 2014, 07:44:01 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_browser.py
r12239 r12240 37 37 from waeup.ikoba.app import Company 38 38 from waeup.ikoba.interfaces import ( 39 IUserAccount, IJobManager, APPROVED, SUBMITTED, 39 IUserAccount, IJobManager, APPROVED, SUBMITTED, PUBLISHED, 40 40 IFileStoreNameChooser, IExtFileStore, IFileStoreHandler) 41 41 from waeup.ikoba.imagestorage import ( … … 151 151 'href="http://localhost/app/documents/d101/sample.pdf">PDF File</a>' 152 152 in self.browser.contents) 153 # Browsing the link shows a real pdf 154 self.browser.open('sample.pdf') 153 # Browsing the link shows a real pdf only if the document 154 # has been published 155 self.browser.getLink("PDF File").click() 156 self.assertTrue( 157 'The document requested has not yet been published' 158 in self.browser.contents) 159 IWorkflowState(document).setState(PUBLISHED) 160 self.browser.getLink("sample.pdf").click() 155 161 self.assertEqual( 156 162 self.browser.headers['content-type'], 'application/pdf') 157 163 158 164 # Transitions can be performed 165 self.assertEqual(document.state, 'published') 159 166 self.browser.open(self.container_path + '/d101') 160 167 self.browser.getLink("Transition").click() 161 self.browser.getControl(name="transition").value = [' publish']168 self.browser.getControl(name="transition").value = ['retract'] 162 169 self.browser.getControl("Save").click() 163 self.assertEqual(document.state, ' published')170 self.assertEqual(document.state, 'created') 164 171 165 172 # Documents can be removed … … 189 196 % document.document_id in logcontent) 190 197 self.assertTrue( 191 'INFO - zope.mgr - %s - Document published' % document.document_id198 'INFO - zope.mgr - %s - Document retracted' % document.document_id 192 199 in logcontent) 193 200 self.assertTrue(
Note: See TracChangeset for help on using the changeset viewer.