- Timestamp:
- 3 Jan 2015, 07:12:59 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/customers/tests/test_browser.py
r12367 r12369 38 38 SkeletonCustomerDocumentProcessor, 39 39 SkeletonContractProcessor) 40 from ikobacustom.skeleton.testing import FunctionalLayer 40 from ikobacustom.skeleton.testing import FunctionalLayer, samples_dir 41 41 42 42 SAMPLE_IMAGE = os.path.join(os.path.dirname(__file__), 'test_image.jpg') … … 253 253 self.assertEqual( 254 254 self.browser.headers['content-type'], 'application/pdf') 255 256 class ContractUITests(CustomersFullSetup): 257 # Tests for contract related views and pages 258 259 layer = FunctionalLayer 260 261 def test_view_slips(self): 262 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 263 # Officers can open contract slips. 264 # First we add a submitted document and a product. 265 IWorkflowState(self.document).setState('submitted') 266 self.contract.document_object = self.document 267 self.contract.product_object = self.product 268 self.contract.tc_dict = {'en': u'<strong>Hello world</strong>'} 269 self.browser.open(self.customer_path + '/contracts/CON1') 270 self.browser.getLink("Download contract slip").click() 271 self.assertEqual(self.browser.headers['Status'], '200 Ok') 272 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 273 path = os.path.join(samples_dir(), 'contract_slip.pdf') 274 open(path, 'wb').write(self.browser.contents) 275 print "Sample contract_slip.pdf written to %s" % path
Note: See TracChangeset for help on using the changeset viewer.