- Timestamp:
- 16 Mar 2015, 10:02:14 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12770 r12772 50 50 from waeup.ikoba.products.productoptions import ProductOption 51 51 from waeup.ikoba.customers.interfaces import CurrencyMismatch 52 from waeup.ikoba.payments.payment import Payment 53 from waeup.ikoba.payments.interfaces import IPayer, IPayable, STATE_PAID 52 54 53 55 PH_LEN = 15911 # Length of placeholder file … … 1291 1293 'Select payment method (final submission)') 1292 1294 1295 def setup_payment(self): 1296 payer = IPayer(self.customer) 1297 payable = IPayable(self.contract) 1298 self.payment = Payment(payer, payable) 1299 self.payment.gateway_service = 'demo_creditcard' 1300 self.payment.state = STATE_PAID 1301 self.app['payments'][self.payment.payment_id] = self.payment 1302 1293 1303 def add_product_option(self, contract): 1294 1304 prodoption = ProductOption() … … 1565 1575 print "Sample contract_slip.pdf written to %s" % path 1566 1576 1577 def test_view_receipt(self): 1578 self.add_product_option(self.contract) 1579 self.setup_payment() 1580 IWorkflowState(self.document).setState(SUBMITTED) 1581 self.contract.document_object = self.document 1582 self.contract.product_object = self.product 1583 self.contract.title = u'Contract Title' 1584 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 1585 # Officers can open the receipt 1586 self.browser.open(self.customer_path + '/contracts/CON1') 1587 self.browser.getLink("Download payment receipt").click() 1588 self.assertEqual(self.browser.headers['Status'], '200 Ok') 1589 self.assertEqual( 1590 self.browser.headers['Content-Type'], 'application/pdf') 1591 path = os.path.join(samples_dir(), 'contract_payment_receipt.pdf') 1592 open(path, 'wb').write(self.browser.contents) 1593 print "Sample contract_payment_receipt.pdf written to %s" % path 1594 1567 1595 def test_contract_approval(self): 1568 1596 # This is not a UI test. It's just a functional test.
Note: See TracChangeset for help on using the changeset viewer.